matlab - Getting intensity value for all pixels in an image -
i have create algorithm determine dark "grayscale image" in matlab, have collect pixels' intensity value evaluate if 65% of pixels in particular image lesser 100 dark.
the question how collect/get these value create algorithm this?
assume image contained in array img
(for instance, obtained imread
). then:
% define threshold th = 100; % percentage of pixels below threshold p = nnz(img<th)/numel(img)*100; % decide if p<65 ... else ... end
hope helps,
Comments
Post a Comment