Detecting blob with straight or round ends
1 view (last 30 days)
Show older comments
Hi everyone,
As you can see I have an image here of objects with different shapes. Each object has either a round or straight/flat ends. The objects are classified such that if they have both rounded ends they are called a cigar, if both are straight it's a square rod and if half is round it's a half-cigar. I was wondering if there is an easy way around to detect the straight or round ends of the object? It will be great to receive some inputs from the MATLAB community.
Cheers,

How
0 Comments
Answers (1)
Image Analyst
on 13 Jan 2023
Try bwferet to get the endpoints of the cigars. Then take a certain number of point around the endpoint and fit it to a circle using the attached function. Compute the distance of the training set to the fitted circle to get the average deviation from a circular shape. See how much that number varies for each shape of end. Circular ends will have a low deviation while non-circular ends will have a higher number.
4 Comments
See Also
Categories
Find more on Image Processing and Computer Vision 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!