Re: mosaic two images in direct graphics [message #44362] |
Fri, 10 June 2005 06:28  |
Chris Lee
Messages: 101 Registered: August 2003
|
Senior Member |
|
|
In article <3gqvbmFdhiinU1@uni-berlin.de>, "Sebastian"
<swalter@zedat.fu-berlin.de> wrote:
> Hello group,
> i have two (or even more) images of irregular shape (in fact, they are
> referenced orbits of a satellite), the rest of the image is black. i
> ....
> some advice??? Thanks in advance!
> Viele Gruesse
> Sebastian
If you want to merge scientific datasets and not pictures,
you might want to use all the data you have, e.g.
; data = [n_images, image_x, image_y]
;invalid =value of 'black'
valid=data ne invalid
new_data= total(valid*data,0)/(total(valid, 0) > 1)
which will give you the averages of overlapping pixels, and probably an
error message because I haven't tested it. missing data can be handled
either using WHERE or using a few more terms in the above equation.
Chris.
|
|
|
|
Re: mosaic two images in direct graphics [message #44370 is a reply to message #44364] |
Thu, 09 June 2005 13:35   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Sebastian Walter writes:
> Thanks for your reply. I don't have access to the book. My problem is to
> draw the images, but not to draw a specific color (black in my case). The
> images are generated using MAP_PATCH (there is no other way, like
> MAP_IMAGE, which would leed to a mask -- AFAIK), so there is plenty of
> black surrounding the orbit strips of the satellite.
>
> The only application of the Z buffer that i can imagine in this case would
> be to draw the images in Z buffer, read them back in an array of images
> (or a structure), and then add and scale them before displaying again.
> This would lead to some kind of transparency (but would even "merge" the
> overlapping images together). Isn't there a more direct way just for not
> drawing black?
If the "colored" part of the images don't overlap, and the
black pixels have a 0 value, then something as simple as
this would work:
TV, image1 > image2 > image3
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: mosaic two images in direct graphics [message #44371 is a reply to message #44370] |
Thu, 09 June 2005 13:13   |
Sebastian
Messages: 5 Registered: June 2005
|
Junior Member |
|
|
Thanks for your reply. I don't have access to the book. My problem is to
draw the images, but not to draw a specific color (black in my case). The
images are generated using MAP_PATCH (there is no other way, like
MAP_IMAGE, which would leed to a mask -- AFAIK), so there is plenty of
black surrounding the orbit strips of the satellite.
The only application of the Z buffer that i can imagine in this case would
be to draw the images in Z buffer, read them back in an array of images
(or a structure), and then add and scale them before displaying again.
This would lead to some kind of transparency (but would even "merge" the
overlapping images together). Isn't there a more direct way just for not
drawing black?
Any help is greatly appreciated.
sebastian
On Thu, 9 Jun 2005, Chi-Kuei Wang wrote:
> It seems to me that you need to draw in Z buffer (in order to use
> transparency) and copy the resultant image to the display window. If you have
> a hold of David Fanning's book, there is a similar example to follow.
|
|
|
Re: mosaic two images in direct graphics [message #44376 is a reply to message #44371] |
Thu, 09 June 2005 09:15   |
Chi-Kuei Wang
Messages: 4 Registered: May 2005
|
Junior Member |
|
|
It seems to me that you need to draw in Z buffer (in order to use
transparency) and copy the resultant image to the display window. If you
have a hold of David Fanning's book, there is a similar example to follow.
Chi-Kuei
Sebastian wrote:
> Hello group,
>
> i have a problem merging two images together, and couldn't find
> information for a solution.
>
> My problem:
>
> i have two (or even more) images of irregular shape (in fact, they are
> referenced orbits of a satellite), the rest of the image is black.
> i want to draw the two images using direct graphics. If i just use TV or
> TVSCL, the surrounding (black) part of the image overplots the first
> image, so i can't see both orbits.
> The technique of simply adding the arrays is not satisfying as i want to
> add many images with different sizes and i do not want to process them
> individually.
>
> My approach would be to te tell TV not to draw the black color, that
> would be sufficient. Some sort of transparency would solve my problem as
> well.
>
> If it is possible in object graphics for sure, i am willing to transfer
> my program to that....
>
> some advice??? Thanks in advance!
>
> Viele Gruesse
> Sebastian
|
|
|
Re: mosaic two images in direct graphics [message #44446 is a reply to message #44362] |
Mon, 13 June 2005 09:16  |
Sebastian
Messages: 5 Registered: June 2005
|
Junior Member |
|
|
Thank You. With 1's instead of 0's in the TOTAL function it works and
gives me a quite homogenic dataset. For really smooth images I have to
do a histogram stretch.
Sebastian
Christopher Lee wrote:
> If you want to merge scientific datasets and not pictures,
> you might want to use all the data you have, e.g.
>
> ; data = [n_images, image_x, image_y]
> ;invalid =value of 'black'
> valid=data ne invalid
> new_data= total(valid*data,0)/(total(valid, 0) > 1)
>
> which will give you the averages of overlapping pixels, and probably an
> error message because I haven't tested it. missing data can be handled
> either using WHERE or using a few more terms in the above equation.
>
> Chris.
|
|
|