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

Crop detected region with result from .txt file but I got the wrong region? #471

Open
Cabbagehust2507 opened this issue Oct 19, 2020 · 1 comment

Comments

@Cabbagehust2507
Copy link

The results from .txt file is different from coordinates when you draw bounding box?

@cuongngm
Copy link

cuongngm commented Oct 30, 2020

The results from .txt file is different from coordinates when you draw bounding box?
Reason: The results from .txt file is coordinates: (x_top_left, y_top_left, x_top_right, y_top_right, x_bot_right, y_bot_right, x_bot_left, y_bot_left) of resize image (variable "img" in line 88 of file main/demo.py).
Solution: You can visualize and draw bounding box and crop by way:
-get x_top_left, y_top_left, x_bot_right, y_bot_right from .txt file
-add code: cv2.rectangle(img, (x_top_left, y_top_left), (x_bot_right, y_bot_right),...) to line 118 of file main/demo.py

Note: line 109 author resized it to original img, you need rename it

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

No branches or pull requests

2 participants