karolzak / boxdetect

BoxDetect is a Python package based on OpenCV which allows you to easily detect rectangular shapes like character or checkbox boxes on scanned forms.
MIT License
104 stars 20 forks source link

Potential bug in `boxdetect.pipelines.get_boxes()` when resizing the image #6

Closed karolzak closed 4 years ago

karolzak commented 4 years ago

It seems like it's scalling the height (image.shape[0]) with scaling_factor and then passing this value as the desired width into imutils.resize()

https://github.com/karolzak/boxdetect/blob/37147f0e4edf14b1ac5b82c876cf2127058de5fb/boxdetect/pipelines.py#L48-L49

Proposed fix:

        image = imutils.resize(
            image, width=int(image.shape[1] * scaling_factor))