MATLAB: Is there a way to identify each pixel of an image. Help needed!

image processingscanscanning element

Is there a way to create a scanning element that could scan each pixel of a bw image and perform some operations, if the pixel being scanned is white or just advance to the next pixel if it is black. I don't want pixel repetition. Please help me ASAP. I'm doing this for my college project!!
Thanks in Advance!

Best Answer

Sure, a for-loop!
I = your_image
for ii = 1:numel(I)
if I(ii)
do_something_with(I(ii))
end
end