Hello everyone,
I used an algotithm in order to detect the curvature of a racing circuit.
Now, I would like to count how many curves and straight there are. I used a threshold to discriminate the points of the curves and straight lines, obtaining the coordinates of the curves. I plot those points on the original image, obtaining this result
I add the number of the "cluster" that I would like to obtain. In the image there is an arrow that indicates a particular type of points, i.e. a "broken" curve. For the moment I would not consider the problem, considering the curves formed by at least by 2-3 points.
Thanks for answering.

 채택된 답변

Image Analyst
Image Analyst 2022년 12월 11일

0 개 추천

Not too hard. You can use bwlabel or regionprops to find, count, and get the lengths of each curvy portion. You just need to give an array where the index is true if the place is curvy and false if it's not curvy. Then
[labeled, numCurves] = bwlabel(mask);
props = regionprops(labeled, 'Area'); % Get length (# of elements) of each curve.
numCurves = numel(props); % Another way of counting curves.
If yoiu still can't figure it out then attach your vector of where the red + markers are.

추가 답변 (0개)

질문:

2022년 12월 11일

편집:

2022년 12월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by