Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: Difficult L...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 8 Topic 5670 of 6022
Post > Topic >>

Re: Difficult Label_region question

by Gaurav <selfishgaurav@[EMAIL PROTECTED] > Apr 23, 2008 at 11:11 PM

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
 




 8 Posts in Topic:
Difficult Label_region question
moxament@[EMAIL PROTECTED  2008-04-23 19:21:08 
Re: Difficult Label_region question
Jonathan Dursi <ljdurs  2008-04-23 21:33:29 
Re: Difficult Label_region question
Gaurav <selfishgaurav@  2008-04-23 23:11:25 
Re: Difficult Label_region question
Gaurav <selfishgaurav@  2008-04-24 01:33:20 
Re: Difficult Label_region question
moxament@[EMAIL PROTECTED  2008-04-24 05:32:17 
Re: Difficult Label_region question
"mgalloy@[EMAIL PROT  2008-04-24 10:55:02 
Re: Difficult Label_region question
moxament@[EMAIL PROTECTED  2008-04-24 16:43:00 
Re: Difficult Label_region question
Gaurav <selfishgaurav@  2008-04-25 00:09:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 22:39:17 CDT 2008.