You just need to adjust the threshold of the grayScale image to include the gray dotted lines path while finding the contours, As the major part of input image is white so we can choose the threshold close to 255, say 230. And then find the contours thresholding.
You may use cv2.approxPolyDP to calculate the approximate polynomial shape, but it won't help much, so that step is optional.
You just need to adjust the threshold of the grayScale image to include the gray dotted lines path while finding the contours, As the major part of input image is white so we can choose the threshold close to 255, say 230. And then find the contours thresholding.
You may use
cv2.approxPolyDP
to calculate the approximate polynomial shape, but it won't help much, so that step is optional.The code snippet may look like this: