Hello MathWorks community,
I could use your help programatically cropping a matrix / image I have. I would like to find the inner bounding box, such that the box only contains the image with no 'dark' regions.
I've tried using the regionprops function already (extrema and bounding box), however the result isn't exactly what I want.
frame = img>0;
extrema = regionprops(frame,'extrema');
box = regionprops(frame,'BoundingBox');
Extrema unreliably returns the bounding edges, and BoundingBox returnes the outer bonding box which includes 'dark' regions.
Any thoughts on how to tackle this problem would be greatly appreciated!