我正在使用Octave分析一些图像。现在,我使用两个嵌套的for循环访问每个像素,但这确实很慢。
我的代码是这样的:
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
Run Code Online (Sandbox Code Playgroud)
没有八度中的循环,有没有办法做到这一点?
提前致谢。