Open lsorgi opened 6 years ago
You could start with an RDom.
RDom r(0,N); output(x,y) = maximum(x,y,r);
How large is N? If all images fit in memory, and are stored XxYxP (Where P is the dimension across which you store multiple images) the above with say a .parallel(y).vector(x,<>) should give you decent results.
Hi Ashish
thanks! I did actually something similar. the number of images are between 3 and 5... so the image stack fits in memory as a WxHxN array
I don't need to compute exactly the max, rather
Output(x,y) = Input_i(x,y)
i = max k in {0,...,N-1}( | Input (x,y) | )
Input_i(x,y) are int16_t
I implemented it using a select (see below) besides x-vectorization and y-parallelization, do you have additional hints? thanks!
// in_data_pt and out_data_pt are preallocated buffers
Var x, y;
Buffer
Sorry dont have anything more. Maybe try argmax? maybe it vectorizes better - wont know till you experiment.
hi
I am a Halide user. I was wondering which is the most efficient way to process an image stack, for example to create the 'max' ouput image:
output(x,y) = max_{i = 0, ...N - 1 } ( input_i(x,y) )
thanks for the hint