1

Serpentine pcb track

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

matru878
  • 33
  • 4
  • 1
    Count the number of corners and divide appropriately. See cv2.goodFeaturesToTrack() at https://docs.opencv.org/4.1.1/dd/d1a/group__imgproc__feature.html#ga1d6bb77486c8f92d79c8793ad995d541 – fmw42 Apr 16 '22 at 16:44
  • Approach #1: Count number of corners in the image with [`cv2.goodFeaturesToTrack`](https://docs.opencv.org/3.4/d4/d8c/tutorial_py_shi_tomasi.html), the number of bends = (number of corners)/2 - 1. Approach #2: With the assumption that the image is just the PCB layout trace with no other lines, you can create a vertical shaped kernel to filter out vertical lines then count the number of contours. The answer will be # of contours - 1 – nathancy Apr 17 '22 at 03:17

0 Answers0