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

Home » Public Forums » archive » Re: Difficult Label_region question
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: Difficult Label_region question [message #59983 is a reply to message #59982] Wed, 23 April 2008 23:11 Go to previous messageGo to previous message
Gaurav is currently offline  Gaurav
Messages: 50
Registered: January 2007
Member
You definitely do not need LABEL_REGION as far as I understand your
problem. As far as I get it you want to create a new 2D array whose
each element will identify whether the highest DN value for that
location lies in Red, Green or the Blue channel.

If I am right so far, then you are assigning wrongly in your code. In
your example if, say, the blue DN value of a pixel is greater than the
Red and Green value for that pixel, you are assigning the value of
Blue DN value in the imnew array. However, what you should do is to
just assign the lable signifying 'blue' for that pixel. If I assume 1
for Blue, 2 for Green and 3 for Red, I would write the same code as

if im[i, j, 0] qt im[i, j, 1] and im[i, j, 0] qt im[i, j,
2] then imnew[i, j] = 1

So, in the end your imnew array will contain only values 1,2 or 3
which when displayed as a pseudo color image will give you the desired
output.

If, however, you wish to preserve the gray level along with it being
displayed as RGB, you could consider converting your imnew to be a
Integer type of array and than assign the values of the array as:

if im[i, j, 0] qt im[i, j, 1] and im[i, j, 0] qt im[i, j,
2] then imnew[i, j] = 0 * 255 + im[i, j, 0] ; or similarly 1*255 +
im[i, j, 1] and so on

This way if a pixel is of blue color, its value will lie between 0-255
in the output array, if it is green it will be between 256-511 and so
on. But I am not sure how you will display this as your output image
in RGB.

In any case, LABEL_REGION figures nowhere, so stop looking in the
wrong place.

Cheers,
Gaurav
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Difficult Label_region question
Next Topic: dlm file not found automatically

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

Current Time: Sat Oct 11 14:03:26 PDT 2025

Total time taken to generate the page: 1.36731 seconds