I have an image made up of lines; how can I find the endpoints with OpenCV?
The lines are about 20 pixels wide. They turn, branch, and can be at angles (although mos
I speak Chinese, while my English is poor.
So I just post my core steps.
A general way to find endpoints of lines is:
Binary the gray image.skeleton of the binary image.hit-miss operation (all end points) or goodFeaturesToTrack(all corners include endpoints) on the skeleton.Notice:
You should select a good skeleton method to make sure that the endpoints wouldn't shrink(while my example does shrink).
This is the result.
This is a demo using hit-miss to find special points.