1 | initial version |
You can try to use next algorithm: 1. Use FindContours to your image. 2. Divide contour to small segments (e.g. 5px). 3. Use equation of line and her perpendicular from analytical geometry: Ax+Bx=0 (in code you can use abs(Ax+Bx)
I use similar algorithm for calculating wire thickness from video, see screenshot .
2 | No.2 Revision |
You can try to use next algorithm: 1. Use FindContours to your image. 2. Divide contour to small segments (e.g. 5px). 3. Use equation of line and her perpendicular from analytical geometry: Ax+Bx=0 between segement and points from contour (in code you can use abs(Ax+Bx)
I use similar algorithm for calculating wire thickness from video, see screenshot .
3 | No.3 Revision |
You can try to use next algorithm:
1. Use FindContours to your image.
2. Divide contour to small segments (e.g. 5px).
3. Use equation of line and her perpendicular from analytical geometry: Ax+Bx=0 between segement and points from contour (in code you can use abs(Ax+Bx)
abs(Ax+Bx) < th (th some threshold e.g. 0.5,1.0...).
I use similar algorithm for calculating wire thickness from video, see screenshot .