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

Home » Public Forums » archive » Re: How to display two images using tvscl
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
Re: How to display two images using tvscl [message #65023] Mon, 09 February 2009 21:19 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
frankosuna writes:

> For some reason the color scheme is completely different.
> The support image color is changed as well as the color
> of the edge detected image(supposed to be white).

Well, it looks to me like those images are 24-bit JPEGs.
That is going to make things very difficult. Did the data
*come* that way, or did you make those images JPEGs for some
reason?

It is *much* harder to do something sensible with color
pixels than it is to work with data pixels. Then, the two
images I downloaded from your URLs were different sizes.
Sigh...

Is this *really* what we have to work with?

Give me some good news and maybe we can sort this out
for you. :-)

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.")
Re: How to display two images using tvscl [message #65028 is a reply to message #65023] Mon, 09 February 2009 17:18 Go to previous messageGo to next message
frankosuna is currently offline  frankosuna
Messages: 31
Registered: February 2008
Member
On Feb 9, 2:38 pm, David Fanning <n...@dfanning.com> wrote:
> frankosuna writes:
>> I want to display the first image and then superimpose the edge
>> detected pixels but I'm not sure how to go about
>> pulling out the white pixels and then displaying them on top of the
>> supporImage.
>
>> Any ideas?
>
>    Loadct, 0, NCOLORS=128
>    LoadCT, 2, NCOLORS=128, BOTTOM=128
>    TV, Btyscl(image1, TOP=127) + $
>        BytScl(image2, TOP=127) + 128B
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

For some reason the color scheme is completely different.
The support image color is changed as well as the color
of the edge detected image(supposed to be white).
Re: How to display two images using tvscl [message #65030 is a reply to message #65028] Mon, 09 February 2009 15:16 Go to previous messageGo to next message
frankosuna is currently offline  frankosuna
Messages: 31
Registered: February 2008
Member
I'll give this a try. Thanks again!!


On Feb 9, 2:38 pm, David Fanning <n...@dfanning.com> wrote:
> frankosuna writes:
>> I want to display the first image and then superimpose the edge
>> detected pixels but I'm not sure how to go about
>> pulling out the white pixels and then displaying them on top of the
>> supporImage.
>
>> Any ideas?
>
>    Loadct, 0, NCOLORS=128
>    LoadCT, 2, NCOLORS=128, BOTTOM=128
>    TV, Btyscl(image1, TOP=127) + $
>        BytScl(image2, TOP=127) + 128B
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: How to display two images using tvscl [message #65036 is a reply to message #65030] Mon, 09 February 2009 13:44 Go to previous messageGo to next message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Mon, 9 Feb 2009, frankosuna wrote:

> Hello I have two images:
>
> http://frankosuna.googlepages.com/supportImage.jpg
>
> http://frankosuna.googlepages.com/edgeDetect.jpg
>
> I want to display the first image and then superimpose the edge
> detected pixels but I'm not sure how to go about
> pulling out the white pixels and then displaying them on top of the
> supporImage.
>
> Any ideas?
>
> Thanks,
>
> Frank Osuna
>

Make the edge image bi-level (0b and 255b), then OR the two images.

regards,
lajos
Re: How to display two images using tvscl [message #65037 is a reply to message #65036] Mon, 09 February 2009 13:42 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
frankosuna writes:

> Hello I have two images:
>
> http://frankosuna.googlepages.com/supportImage.jpg
>
> http://frankosuna.googlepages.com/edgeDetect.jpg
>
> I want to display the first image and then superimpose the edge
> detected pixels but I'm not sure how to go about
> pulling out the white pixels and then displaying them on top of the
> supporImage.

This is very similar to what you do when you
sharpen an image:

http://www.dfanning.com/ip_tips/sharpen.html

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: How to display two images using tvscl [message #65038 is a reply to message #65037] Mon, 09 February 2009 13:38 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
frankosuna writes:

> I want to display the first image and then superimpose the edge
> detected pixels but I'm not sure how to go about
> pulling out the white pixels and then displaying them on top of the
> supporImage.
>
> Any ideas?

Loadct, 0, NCOLORS=128
LoadCT, 2, NCOLORS=128, BOTTOM=128
TV, Btyscl(image1, TOP=127) + $
BytScl(image2, TOP=127) + 128B

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: How to display two images using tvscl [message #65163 is a reply to message #65023] Wed, 11 February 2009 17:52 Go to previous message
frankosuna is currently offline  frankosuna
Messages: 31
Registered: February 2008
Member
On Feb 9, 10:19 pm, David Fanning <n...@dfanning.com> wrote:
> frankosuna writes:
>> For some reason the color scheme is completely different.
>> The support image color is changed as well as the color
>> of the edge detected image(supposed to be white).
>
> Well, it looks to me like those images are 24-bit JPEGs.
> That is going to make things very difficult. Did the data
> *come* that way, or did you make those images JPEGs for some
> reason?
>
> It is *much* harder to do something sensible with color
> pixels than it is to work with data pixels. Then, the two
> images I downloaded from your URLs were different sizes.
> Sigh...
>
> Is this *really* what we have to work with?
>
> Give me some good news and maybe we can sort this out
> for you. :-)
>
> 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.")

I have two .dat files which I suppose is a binary image files. I
create them the following way:

image = TVRead(Filename='edgeDetect',/NODIALOG,/BMP)

image = READ_BMP('/home/users/fjosuna/CASVU_ISS/edgeDetect.bmp')
OPENW, lun, 'edgeDetect.dat', /GET_LUN
WRITEU, lun, image
FREE_LUN, lun

ERASE

tvscl, congrid(realImage, 1024, 1024)
image = TVRead(Filename='realImage',/NODIALOG,/BMP)

image = READ_BMP('/home/users/fjosuna/CASVU_ISS/realImage.bmp')
OPENW, lun, 'realImage.dat', /GET_LUN
WRITEU, lun, image
FREE_LUN, lun

ERASE

The first one is the edge detected file and the second is the image
that edge
detection was performed on. They both should be 1024x1024 images.

I then want to display the real image first and on top the edge
detected image
which I do like this:


; Create a window and display the image.
WINDOW, 0, XSIZE = dims[0], YSIZE = dims[1], $
TITLE = 'Click on an Edge to navigate on.'
;TVSCL, congrid(realImage,dims[0],dims[1])
;Loadct, 0, NCOLORS=128
;LoadCT, 2, NCOLORS=128, BOTTOM=128
TVSCL, Bytscl(realImage, TOP=127) + $
Bytscl(img,TOP=127)

Both files realImage and img are the bmp files for the edge detected
image and
the real image.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Colorbar Labels Issue
Next Topic: why the idlgrwindow select can't performant??!!!

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

Current Time: Wed Oct 08 15:21:52 PDT 2025

Total time taken to generate the page: 0.00631 seconds