speed up image processing [message #67437] |
Thu, 23 July 2009 05:53 |
Klemen
Messages: 80 Registered: July 2009
|
Member |
|
|
Hi, I quite new to IDL, I know its basics, and I have recently found
out that using the right approach can significant speed up the
processing. My problem is, I have a 2D array and I would like to
compute a minimum and some additional stuff for each input image pixel
from the predefined vector that stretches out of each pixel.
Currently, I use simply 2 for loops. Is there a way to do this faster
- removing for loops?
Thank you, Klemen
vector_indx = [ncols+1, 2*ncols+2, 3*ncols+3]
for j = 0,nrows do begin
for i = 0,ncols do begin
x = image(i,j) ;read the current pixel data
indx = j*ncols + i ;convert to 1D index
image_out(i,j) = min(image[vector_indx+indx])
...
endfor
endfor
|
|
|