This is an implementation of the algorithm developed by:
G. LANDINI, D. A. RANDELL, S. FOUAD & A. GALTON, "Automatic thresholding from the gradients of region boundaries", Journal of Microscopy, Vol. 265, Issue 2 2017, pp. 185–195
"We present an approach for automatic threshold segmenta-tionofgreyscaleimages.Theprocedureisinspiredbyareinter-pretation of the strategy observed in human operators whenadjusting thresholds manually and interactively by means of‘slider’ controls. The approach translates into two methods.The first one is suitable for single or multiple global thresh-olds to be applied globally to images and consists of searchingfor a threshold value that generates a phase whose bound-ary coincides with the largest gradients in the original image.The second method is a variation, implemented to operate onthe discrete connected components of the thresholded phase(i.e. the binary regions) independently. Consequently, this be-comes an adaptive local threshold procedure, which operatesrelative to regions, rather than to local image subsets as is thecaseinmostlocalthresholdingmethodspreviouslypublished.Adding constraints for specifying certain classes of expectedobjects in the images can improve the output of the methodover the traditional ‘segmenting first, then classify’ approach"
Example usage:
Amin = min particle area to detect
Amax = max particle area to detect
Cmin = min particle circularity to detect
Lmin = Lower threshold grayscale level
Lmax = Upper threshold grayscale level
For very large images the "for" in line 46 can be swapped for "parfor" if you have the paralel computing toolbox. This will speed up the algorithm.
I = imread('coins.png');
Rfill = Landini_Threshold(I,Amin,Amax,Cmin,Lmin,Lmax);
imshow(Rfill)
引用格式
Robin Hartley (2024). Landini Threshold - Automatic Segmentation (https://www.mathworks.com/matlabcentral/fileexchange/119913-landini-threshold-automatic-segmentation), MATLAB Central File Exchange. 检索来源 .
MATLAB 版本兼容性
创建方式
R2022b
兼容任何版本
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!