How can I detect and crop an evolving specimen profile?
1 view (last 30 days)
Show older comments
Abhishek PALCHOUDHARY on 5 Mar 2021
Answered: Abhishek Kolla on 2 Aug 2021
I have images of a specimen whose shape changes due to loading. To proceed in my analysis, I would like to be able to retain only the front face of the specimen, and remove the background. I can of course manually draw the region I want to keep and crop the rest, but because there are over 2000 images, I'd like to automate this process. Only trouble is, I can't just draw one mask and use it to crop all the images - the shape of the front face of the specimen doesn't stay constant over the 2000 images, and is changing ever so slightly, image to image (evolving profile, pictures attached).
Any ideas for profile detection? I've added some images, to make it clearer.
Abhishek Kolla on 2 Aug 2021
Find the edges of the binary image to get a mask of the specimen . Edges can be found using Find edges in intensity image - MATLAB edge (mathworks.com)
To remove the spurious edges we can apply morphological operations on the image using Morphological operations on binary images - MATLAB bwmorph (mathworks.com)
Then find all the co-ordinates of the mask generated in the original image using minimum and maximum.
Kindly have a look at the following example code:
minx=10000; miny=10000; maxx=-1;maxy=-1;
The output obtained on one of the Test image is enclosed
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!