File Exchange

image thumbnail

version (1.07 KB) by 2one
Otsu thresholding for image segmentation


Updated 17 Oct 2014

View License

% otsu.m
% Otsu image thresholding (for image thresholds > 0)
% Otsu, N., "A Threshold Selection Method from Gray-Level Histograms," IEEE Transactions on Systems, Man, and Cybernetics, Vol.
% 9, No. 1, 1979, pp. 62-66.
% Similar to MATLAB function graythresh.m
% input: image (IM)
% output: binary image (IM_OTSU) and optimal threshold value

Comments and Ratings (1)

Adrien Mau

"for i = 1:length(IM(1,:));

for j = 1:length(IM(:,1));

if IM(i,j) ... "
Here i is the number of lines so it should be i = 1:length(IM(:,1)); and j = 1:length(IM(1,:))



MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.

Learn About Live Editor