text-detection-ctpn icon indicating copy to clipboard operation
text-detection-ctpn copied to clipboard

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

Open Cabbagehust2507 opened this issue 4 years ago • 1 comments

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

Cabbagehust2507 avatar Oct 19 '20 04:10 Cabbagehust2507

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

cuongngm avatar Oct 30 '20 09:10 cuongngm