How can I detect whether a line is a straight line or curve from an binary image?

3 views (last 30 days)
differentiate between straight line and a curve

Answers (1)

Image Analyst
Image Analyst on 25 Apr 2014
Call regionprops to get the area and the PixelIdxList. Use Pythagorean theorem to get the distance between the two farthest points. Compare that to the area, which is the length along the curve. Decide upon some ratio that divides "straight" from "curvy".

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!