Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove zero boxes after detection #198

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Acinonyx4
Copy link

The CRAFT text detection produced false positive detections under some condition (e.g. with text_threshold = 0.01, link_threshold = 0.01, low_text = 0.1 and my pictures).

While most of the predicted text boxes are correct, there are wrong predictions containing only zero values (screenshot showes print of 4 predicted boxes and there are 2 wrong boxes only with zeros as values).
Zero Boxes problem

That can lead to an error within the craft module depending on the OpenCV version.
I recognized the following error with opencv-python-4.5.4.60:
cv2.error: OpenCV(4.5.4) matrix.cpp:466: error: (-215:Assertion failed) _step >= minstep in function 'cv::Mat::Mat'

To fix that problem, I added a check to remove the zero boxes for further steps

@Acinonyx4 Acinonyx4 changed the title fix: remove null boxes after detection fix: remove zero boxes after detection Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant