Re: Composition structure [message #41104] |
Fri, 01 October 2004 12:12  |
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 #41276 is a reply to message #41104] |
Sun, 03 October 2004 14:57  |
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
|
|
|