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 visualization and default model for text detection PP-OCR #237

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

ryan1288
Copy link
Contributor

Minor PR to correct the default model path and address issues with visualization. The issue was partially discussed in #135 (comment).

@fengyuentau fengyuentau self-assigned this Feb 27, 2024
@fengyuentau fengyuentau added the bug Something isn't working label Feb 27, 2024
@fengyuentau fengyuentau added this to the 4.10.0 milestone Feb 27, 2024
@fengyuentau
Copy link
Member

@WanliZhong Please take a look at this PR.

imshow(kWinName, originalImage);
waitKey(0);
Copy link
Member

@WanliZhong WanliZhong Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 130 has

 while (waitKey(1) < 0)

So I think we don‘t need to add waitKey(0)?

Copy link
Contributor Author

@ryan1288 ryan1288 Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while (waitKey(1) < 0) - I believe this has a timeout of 1 ms before continuing the loop.

It then attempts to go into

cap >> originalImage;
if (originalImage.empty())
{
    if (parser.has("input"))
    {
        cout << "Frame is empty" << endl;
        break;
    }
    else
        continue;
}

and reaches cout << "Frame is empty" << endl;, breaking the loop and ending the program. On the otherhand, waitKey(0) waits indefinitely, allowing the user to keep the processed image up for viewing.

Copy link
Member

@WanliZhong WanliZhong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM👍

@fengyuentau fengyuentau merged commit 80ef421 into opencv:main Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants