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

Home » Public Forums » archive » Overlay a coloured boundary on a gray scale image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Overlay a coloured boundary on a gray scale image [message #81659] Thu, 11 October 2012 04:46 Go to next message
titan is currently offline  titan
Messages: 59
Registered: March 2006
Member
Hi all,
I have a grey scale image and I'm able to overlay the boundary of my region but it is in black.

To improve its visualization I would like to color it(for example in blue)

Is there a way to do it?

since I have the array where the boundary indexes are stored, is there a way to associate to the the RGB triplet of a color?

thanks in advance
Re: Overlay a coloured boundary on a gray scale image [message #81722 is a reply to message #81659] Sun, 14 October 2012 23:38 Go to previous message
titan is currently offline  titan
Messages: 59
Registered: March 2006
Member
On Friday, October 12, 2012 2:35:41 PM UTC+2, David Fanning wrote:
> titan writes:
>
>
>
>> probably my question is not clear :( and I'm sorry for this.
>
>> I try to explain it better:
>
>>
>
>> I'm able to read a shapefile from which I'm able to obtain the corresponding image which is a binary one. Then I can extract those subscripts values where the boundary is
>
>>
>
>> boundary_index = WHERE(boundary_array NE 0)
>
>>
>
>> my gray scale image has the same dimension of the boundary image and as a consequence I can draw the line over it (in white)
>
>>
>
>> image[boundary_index]=255
>
>>
>
>> What I would like to do i to understand if I could draw this line not in white but in another color, for example yellow.
>
>>
>
>> Is there this possibility?
>
>
>
> I presume you are using indexed color to display your image.
>
> Simply load your image colors into indices 0 to 254 and
>
> use color index 255 to load whatever color you like.
>
> I would do it like this:
>
>
>
> LoadCT, 0, NColors=254
>
> TVLCT, 255, 255, 0, 255 ; Yellow in index 255
>
> scaledImage = BytScl(image, TOP=254
>
> scaledImage[bounary_index] = 255
>
> cgImage, scaledImage
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
> Sepore ma de ni thue. ("Perhaps thos speakest truth.")

Hi David,
thanks a lot for your suggestion!! It works perfectly!! :)

Have a nice day
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Pointer and structure question
Next Topic: Empty FOREACH loop

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

Current Time: Wed Oct 08 15:36:44 PDT 2025

Total time taken to generate the page: 0.00551 seconds