How to identify incomplete rectangles in openCV
How would I go around identifying and extracting rectangles from an image such as the one shown below. Note that my rectangles might be incomplete and have some missing edges and some sides might be partial lines. Thanks ! This can be solved using morphological operations such as eroding and dilating . This two operations will help creating closed rectangles. After that you can use the tutorial from this page to detect simple shapes such as rectangles. I implemented a quick demo which worked for the image you provided. main.py: import cv2 import numpy as np from shapeDetector import