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

Home » Public Forums » archive » Re: Composition structure
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: Composition structure [message #41104] Fri, 01 October 2004 12:12 Go to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Jeferson E. wrote:
> Hello there!
>
> Assuming I have 5 images and I want to get the maximum value
> composition. I can use something like that:
>
> Composite = Image1 > Image2 > Image3 > Image4 > Image5
>
> However, in the case I don't know the number of images, I can't use
> this structure. What could be done?

Depends how you call your application, no?

Let's say you have 10 images (say, 800x640) - you'd need to stick them in some sort of
array to allow you code to process an arbitrary number of images,

n = 20
ImageArray = bytarr(800,640,n)
.... here fill you image array....
GetImageMax, ImageArray, ImageMax

where the procedure is something like below:

PRO GetImageMax, ImageArray, $ ; Input
ImageMax ; Output

; -- Get some array info
Info = SIZE( ImageArray, /STRUCTURE )

; -- Is the image array 3-d?
IF ( Info.N_DIMENSIONS NE 3 ) THEN $
MESSAGE, 'Must pass in a 3-D array!'

; -- Determine the number of images
n_Images = Info.DIMENSIONS[2]

; -- Find the maximum
ImageMax = ImageArray[*,*,0]
FOR i = 1, n_Images-1 DO BEGIN
ImageMax = ImageMax > ImageArray[*,*,i]
ENDFOR

END

I'm sure other folks will post cleverer solutions that don't use loops.

paulv
Re: Composition structure [message #41105 is a reply to message #41104] Fri, 01 October 2004 12:07 Go to previous messageGo to next message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
Jeferson E. wrote:
> Hello there!
>
> Assuming I have 5 images and I want to get the maximum value
> composition. I can use something like that:
>
> Composite = Image1 > Image2 > Image3 > Image4 > Image5
>
> However, in the case I don't know the number of images, I can't use
> this structure. What could be done?
>

For any old situation you can loop through the values, for example...

x = 5 & for i = 0, 10 do begin & x >= i & print, i, x & endfor
0 5
1 5
2 5
3 5
4 5
5 5
6 6
7 7
8 8
9 9
10 10


In your case you would do something like the following...

composite = image1
for i = 0, nImages-1 do composite = composite > imagei (or composite >= imagei)

Ben
Re: Composition structure [message #41106 is a reply to message #41105] Fri, 01 October 2004 11:49 Go to previous messageGo to next message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Jeferson E. wrote:
> Hello there!
>
> Assuming I have 5 images and I want to get the maximum value
> composition. I can use something like that:
>
> Composite = Image1 > Image2 > Image3 > Image4 > Image5
>
> However, in the case I don't know the number of images, I can't use
> this structure. What could be done?

Composite = Image1

Then, for each additional image:

Composite = Composite > ImageN
Re: Composition structure [message #41276 is a reply to message #41104] Sun, 03 October 2004 14:57 Go to previous message
jcesq is currently offline  jcesq
Messages: 9
Registered: October 2004
Junior Member
Thanks for all suggestions! I'm going to use Kuyper procedure (the
simplest), once my image have always the same size:

Composite = Image1

Then, for each additional image:

Composite = Composite > ImageN

Best Regards for all...
Jeferson


Paul Van Delst <paul.vandelst@noaa.gov> wrote in message news:<cjkboj$ls7$1@news.nems.noaa.gov>...
> Jeferson E. wrote:
>> Hello there!
>>
>> Assuming I have 5 images and I want to get the maximum value
>> composition. I can use something like that:
>>
>> Composite = Image1 > Image2 > Image3 > Image4 > Image5
>>
>> However, in the case I don't know the number of images, I can't use
>> this structure. What could be done?
>
> Depends how you call your application, no?
>
> Let's say you have 10 images (say, 800x640) - you'd need to stick them in some sort of
> array to allow you code to process an arbitrary number of images,
>
> n = 20
> ImageArray = bytarr(800,640,n)
> .... here fill you image array....
> GetImageMax, ImageArray, ImageMax
>
> where the procedure is something like below:
>
> PRO GetImageMax, ImageArray, $ ; Input
> ImageMax ; Output
>
> ; -- Get some array info
> Info = SIZE( ImageArray, /STRUCTURE )
>
> ; -- Is the image array 3-d?
> IF ( Info.N_DIMENSIONS NE 3 ) THEN $
> MESSAGE, 'Must pass in a 3-D array!'
>
> ; -- Determine the number of images
> n_Images = Info.DIMENSIONS[2]
>
> ; -- Find the maximum
> ImageMax = ImageArray[*,*,0]
> FOR i = 1, n_Images-1 DO BEGIN
> ImageMax = ImageMax > ImageArray[*,*,i]
> ENDFOR
>
> END
>
> I'm sure other folks will post cleverer solutions that don't use loops.
>
> paulv
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: array operators - vector processing relevant
Next Topic: WIDGET ID FINDING FUNCTION

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

Current Time: Fri Oct 10 00:13:23 PDT 2025

Total time taken to generate the page: 0.55439 seconds