You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/lib/python3.10/site-packages/img2table/tables/processing/bordered_tables/lines.py:23, in identify_straight_lines(thresh, min_line_length, char_length, vertical)
21 # Apply masking on image
22 kernel_dims = (1, round(min_line_length / 3)) if vertical else (round(min_line_length / 3), 1)
---> 23 kernel = cv2.getStructuringElement(cv2.MORPH_RECT, kernel_dims)
24 mask = cv2.morphologyEx(thresh, cv2.MORPH_OPEN, kernel, iterations=1)
26 # Apply closing for hollow lines
**Error: OpenCV(4.10.0) /io/opencv/modules/imgproc/src/filterengine.hpp:367: error: (-215:Assertion failed) anchor.inside(Rect(0, 0, ksize.width, ksize.height)) in function 'normalizeAnchor'**
Looks like it's because the kernel dimensions (ksize) being passed to cv2.getStructuringElement are invalid, either being too small (e.g., 0 or negative) or not properly computed.
Hi, Thanks for the quick response.
Unfortunately, I can't share those images as they are confidential.
In case you need to know the OCR instance name, I am using the SuryaOCR.
However, I discovered that when we have a Barcode or QR code in the image, it gives that error.
I tried using a dummy image of the barcode and QR code.
Using img2table 1.3.0
The error I am getting for a few images:
Looks like it's because the kernel dimensions (ksize) being passed to cv2.getStructuringElement are invalid, either being too small (e.g., 0 or negative) or not properly computed.
I tried recreating recreate this error using:
Please look into this.
The text was updated successfully, but these errors were encountered: