Re: how to highlight some pixels in the image [message #30690] |
Thu, 09 May 2002 15:08 |
Xiaoying Jin
Messages: 20 Registered: May 2002
|
Junior Member |
|
|
Thanks for helping me out. Coyote is really an expert at this. Reading a
good program is an enjoy for me.
Best regards,
Xiaoying Jin
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.1743afe22249759f9898c3@news.frii.com...
> David Fanning (david@dfanning.com) writes:
>
>> You load a color:
>>
>> TVLCT, 255, 255, 0, =!D.Table_Size-1
>
> Whoops! Coyote is lurking again...
>
> TVLCT, 255, 255, 0, !D.Table_Size-1
>
> Cheers,
>
> David
> --
> David W. Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438, E-mail: david@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: how to highlight some pixels in the image [message #30704 is a reply to message #30690] |
Wed, 08 May 2002 21:58  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning (david@dfanning.com) writes:
> You load a color:
>
> TVLCT, 255, 255, 0, =!D.Table_Size-1
Whoops! Coyote is lurking again...
TVLCT, 255, 255, 0, !D.Table_Size-1
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: how to highlight some pixels in the image [message #30705 is a reply to message #30704] |
Wed, 08 May 2002 21:56  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Xiaoying Jin (xje4e@mizzou.edu) writes:
> I want to do the following operations in IDL:
> I display a gray level image, select a pixel in the image, the location and
> the gray level of the pixel will be displayed.
> Then all the pixels having the same gray level in the image will be
> highlighted.
>
> How can I program to implement it? Actually, I am a newer for this kind of
> operations. So any suggestion will be appreciated.
You make a copy of your image, scaled so that you can
set one pixel to another color:
display = BytScl(image, Top=!D.Table_Size-2)
You load a color:
TVLCT, 255, 255, 0, =!D.Table_Size-1
You set all the pixels at your value equal to the color:
I = Where(image EQ value, count)
IF count GT 0 THEN display[I] = !D.Table_Size-1
You display the fixed up image:
TV, display
I hacked up a little program I have lying around here
to show you how it is done. It is called Light_Pixel
and you can find it here:
http://www.dfanning.com/misc/light_pixel.pro
Start it like this:
IDL> Light_Pixel
You can pass it your image as an argument, if you like.
When you click your cursor in the image, it will display
the location of the cursor, the value of the image at that
location, and will temporarily (for two seconds) light up
all pixels in the image that have that value with a yellow
color.
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: how to highlight some pixels in the image [message #30706 is a reply to message #30705] |
Wed, 08 May 2002 21:23  |
Xiaoying Jin
Messages: 20 Registered: May 2002
|
Junior Member |
|
|
Or maybe I can implement it in ENVI?
"Xiaoying Jin" <xje4e@mizzou.edu> wrote in message
news:abct59$dl$1@dipsy.missouri.edu...
> Hi, there,
>
> I want to do the following operations in IDL:
> I display a gray level image, select a pixel in the image, the location
and
> the gray level of the pixel will be displayed.
> Then all the pixels having the same gray level in the image will be
> highlighted.
>
> How can I program to implement it? Actually, I am a newer for this kind of
> operations. So any suggestion will be appreciated.
>
> Best regards,
>
> Xiaoying Jin
>
>
|
|
|