comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Newbie to IDL needs help :)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Newbie to IDL needs help :) [message #84313 is a reply to message #84259] Wed, 15 May 2013 05:36 Go to previous message
sulsoftbr is currently offline  sulsoftbr
Messages: 1
Registered: May 2013
Junior Member
I sent you an email, but why not post here, it's an interesting problem ...

There are 5 basic rules you defined, I numbered them from 1 to 5. First you have to create a mask for each of the rules:

Rule 1 : mask1 = (map1 eq map2) and (map1 eq map3) and (map1 eq map4)

Rule 2: mask2 = map1 eq 1 or map1 eq 2 or (map1 ge 4 and map1 le 9) or map1 eq 13

Rule 3: mask3 = map2 eq 3 or map2 eq 8 or map2 eq 12 or map2 eq 14 or map2 eq 14

Rule 4 : mask4 = map3 eq 10

Rule 5 : mask5 = map4 eq 11

Now,

mixed = mask1 +2b*mask2 + 4b*mask3 + 8b*mask4 + 16b*mask5
mixed = mixed * ((mask1+mask2+mask3+mask4+mask5) ge 2)


is an image where non-zero pixel contain a bit code telling you for which classified pixels you met more than one criteria, for instance

mixed[x,y] = 10

would tell you that pixel [x,y] has either value 1,2,4,5,6,7,8,9 or 13 in map1, and value 10 in mask4 - how you go about that is now your decision. For all pixels with value 0 and 1 in "mixed" you can already fill your output classification result:


result = (map1*mask1 + map1*mask2 + map2*mask3 + map3*mask4 + map4*mask5 ) * (mixed le 1)

The "several criteria met" pixels in result will be zero , and you will have to fill these in according to the priority you've choosen.


(Obs: this all assumes you don't have unclassified (value 0 ) pixels in map 1 through 4)

cheers,

Michael


Em sexta-feira, 10 de maio de 2013 08h06min10s UTC-3, alchemym...@gmail.com escreveu:
> On Thursday, May 9, 2013 9:35:38 PM UTC-5, David Fanning wrote:
>
>> I get the idea. I just don't get what you mean when you say
>
>>
>
>> "if a value...". *What* value? In what image? How do you intend
>
>>
>
>> to get started on this problem?
>
>
>
>
>
> Sorry, I misunderstood what part was confusing. Maybe I'm not using the right terms (I need IDL for Dummies). The 'values' I'm referring to are the class assignments (which are in numerical format in ENVI) that range from 1 through 15 (1 is soybeans, 2 is corn, 3 is idle grassland, etc.). The classes (values) are the same for all the classes in each map but the locations of the individual pixels in each map with those values/classes can vary.
>
>
>
> So I already have 4 maps that are classified with the same 'number' scheme (I think of it kinda like a large array, but not sure if that's technically the correct term) and I want to 'merge' them by designating which map's class assignment (what I was calling the value) takes priority. In reading through what I can find on the internet in regards to IDL coding, 'if/then' and 'case' statements kinda sounded like what I needed, but I can't figure it out, and neither of them seems exactly right.
>
>
>
> I want to create a set of assignment 'rules' to establish the pixel values in the final (initially blank) output map. Something like 'if the target value is 1 (soybeans) refer to map 1 (good for soybeans), on the 'final' map give all pixels that share the same location information with soybeans (value 1) pixels from map 1 a value of 1 to indicate soybeans. And then continue this for each class, indicating the class number and the map that I want to use as the 'rule'.
>
>
>
> I have been able to figure out how to write a bit of code that looks at all 4 maps, compares the pixel 'values' and indicates which ones match/don't match across all 4 maps, which is a nice little victory for me, but I'd really prefer to set the priority decision rules and create a merged map. Another idea down the road (if I could figure out IDL) would be to look at all 4 maps, if the values match across all 4 assign that value, if the values don't match across all 4 then use a set of priority rules, etc. But...baby steps...
>
>
>
> Does that make it clearer or am I just making no sense whatsoever? I (thankfully) have other classification and/or software options I can explore if I can't figure this out in the allotted time, but I'd really like to compare a couple of different 'final' maps and see how the different techniques compare from an accuracy standpoint on the type of landscape I'm working on.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to use mpfit fitting routine
Next Topic: Re: how to use mpfit fitting routine

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:03:35 PDT 2025

Total time taken to generate the page: 0.00427 seconds