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 
Return to the default flat view Create a new topic Submit Reply
Re: Composition structure [message #41104] Fri, 01 October 2004 12:12 Go to previous 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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
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: Sat Oct 11 09:29:09 PDT 2025

Total time taken to generate the page: 0.95900 seconds