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

Home » Public Forums » archive » Re: hieghlighting pixel
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: hieghlighting pixel [message #71092 is a reply to message #71091] Thu, 27 May 2010 06:58 Go to previous messageGo to previous message
Juggernaut is currently offline  Juggernaut
Messages: 83
Registered: June 2008
Member
On May 27, 8:11 am, David Fanning <n...@dfanning.com> wrote:
> afzal writes:
>> in my work  i need  to highlight some points(pixels) of binary image
>> with some color(eg:-red). cud anybody help me to do this
>> thanking you
>
> Scale your image into some number of values less
> that 256, then use these "extra" values for your
> colors.
>
>    image = dist(200)
>    scaledImage = BytScl(image, Top=250)
>
> Now, load your colors appropriately. For example,
> your scaled image now has 251 values (0 to 250),
> so the color table is loaded like this:
>
>    LoadCT, 0, NColors=251
>
> Next, load your drawing color. Red in this case,
> at color index number 251:
>
>    TVLCT, 255, 0, 0, 251
>
> Now, select your pixels that will be red:
>
>    indices = Where(image gt 75 and image lt 85, count)
>    IF count gt 0 THEN scaledImage[indices] = 251
>
> Then, just display your image:
>
>    TVImage, scaledImage, /NoInterp, /Keep_Aspect
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Another option is simply to plot them onto the image. Figure out
which pixels you want to highlight and do the following.
xSize and ySize will be the size of the window you are working
with..making sure that the window fits the data by some integer
multiple
For example if my image size was 200x312 and you made a window to
display it in, it should be something like 400x624
xSize = 400, ySize=624
Then you would just multiply your x and y subscripts that you found
and wanted to highlight by the zoom factor (2 in this case)
plot, [0], [0], xmargin=[0,0], ymargin=[0,0], xrange=[0,xSize-1],
yrange=[0,ySize-1], /noerase, /nodata, ystyle=5, xstyle=5
oplot, xInds*2, yInds*2, color=fsc_color('red'), psym=6, symsize=0.15

Voila, you now will have red pixels where you want them and the rest
will remain white or black.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDLDE can not start in Ubuntu10.04
Next Topic: Re: Integrator taking vectors as input?

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

Current Time: Fri Oct 10 20:22:13 PDT 2025

Total time taken to generate the page: 0.00709 seconds