Two functions for working with the Feret diameter of labelized particles in images.
The function imFeretDiameter computes the Feret diameter for each one of the specified directions. The maximal diameter can be obtained by computing the max of the result.
The function imOrientedBox computes Feret diameter for several directions, and keep the direction that produces the minimal-area enclosing rectangle. The function drawOrientedBox can be used for visualising result.
Both functions could easily be adapted to a set of points.
David Legland (2020). Feret diameter and oriented box (https://www.mathworks.com/matlabcentral/fileexchange/30402-feret-diameter-and-oriented-box), MATLAB Central File Exchange. Retrieved .
Thanks for your reply. It's very useful and these codes are concise and beautiful.
you can download y other contribution "imHistogram", also on the FileExchange (https://fr.mathworks.com/matlabcentral/fileexchange/28681-imhistogram).
You can also grab it from the GitHub page of the MatImage toolbox, that gather image processing tools I have written. https://github.com/mattools/matImage
How to find this function "imHistogram" that exists in function of "demoImMaxFeretDiameter"?
Many thanks for this code
Works as desired! Good documentation too.
enhance precision, add psb to specify spatial calibration, and to computes diameter or box only for specific labels