I'm trying to break a continuous line segment into multiple, straight segments.
I've tried using the Hough transform but have found it unreliable for getting the line segments I'm looking for and because it demands too much fine tuning to fit the automated medium I'm working in.
Analyzing points (comparing slopes/averages) as they change has shown some success, but the lines found are often too segmented or too unsegmented (just the whole line), proving unreliable so far. These are also prone to give too much of the subsequent line before cutting off when they have worked.
Contextual restrictions include:
- Only one 'Y' value per X point (this image doesn't show this, but the property holds).
- There are no gaps between points in the line.
- Noise is possible, but not that bad usually (within a few pixels of being correct).
- The lines being detected are straight, not curved.
- This is being developed in C++ using the SDL2 framework.
I feel like I'm overcomplicating this question. How can I find the points that separate the segments? I suspect something comparing averages or averages of averages might be the way to go.