views:

32

answers:

2

I am using Octave to analyze some images. Now I use two nested for-loops to access every pixel but this is really slow.

My code is something like that:

for i = 1:size(im,1)
    for j = 1:size(im,2)
    p = im(i,j,1:3);
        if (classRGB(class, [p(1),p(2),p(3)]) > 0)
            ## Apply some function to that pixel here
        endif
    endfor
endfor

Is there any way to do this without the loops in Octave?

Thanks in advance.