eragonruan/text-detection-ctpn

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

Cabbagehust2507 opened this issue · 1 comments

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

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