How can i use openCV to calculate number of serpentine bends in pcb layout diagram as shown. Here the required output i.e. number of bends is 9. I'm using this script as reference but couldn't find correct output Count the number of rectangles in an image
1
votes
Count the number of corners and divide appropriately. See cv2.goodFeaturesToTrack() at docs.opencv.org/4.1.1/dd/d1a/…
– fmw42
(horizontal) scanline through the tracks, count rising and falling edges. that'll give you 10 crossings, so you can figure 10-1=9 bends -- or skeletonize the trace, then walk it, optionally simplify the path, detect when it changes direction (relative and absolute) -- a single example is impossible to generalize. you'd have to hope for people to have domain knowledge, i.e. read your mind
– Christoph Rackwitz