Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pkg load image;
- pic = randi(256,10);
- hold on
- imshow(mat2gray(pic));
- cols= size(pic,2);
- rows= size(pic,1);
- ints = (0:255);
- ints(:)=0;
- for k = 1:1:256
- ints(k)=sum(pic(:)==k-1);
- end
- figure;
- for c =1:cols
- for r = 1:rows
- val=pic(r,c)+1
- ints(val)++;
- end
- end
- xaxis = (1:1:256) ;
- plot(xaxis,ints,'r');
- hold off;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement