Ask Your Question

please help me to detect an rectangle box on image?

asked 2017-02-02 02:23:41 -0500

Khang gravatar image

updated 2017-02-02 02:44:03 -0500

sorry if i say something wrong guys, my english is bad!


i want to detect that number on my image so how can i do it. i have learned some simple canny detection and i 've done this


Please help me, thanks you


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-02-02 18:15:32 -0500

Tetragramm gravatar image

Image 1 is the only numbers you want?

Look at your resource image. The number you want are the only numbers surrounded by blue. Isolate the color blue, and erase any small bits that are a similar color.

Then find the bounding box (contours, connected components, just checking each row an column for contents, lots of ways to do that).

Then do canny on the bounding box, and you should have something like Image 1. If you want to know the numbers, you need to do OCR, which is THIS module.

edit flag offensive delete link more


great answer, thanks for reply me i will try it out

Khang gravatar imageKhang ( 2017-02-03 08:42:56 -0500 )edit

hi, i have found the box using blue hsv detection bounding_box but i used python to do it :( is that OCR is not supporting for python yet?

Khang gravatar imageKhang ( 2017-02-03 09:37:00 -0500 )edit

I think it is, but you have to install OpenCV contrib, which you have to compile yourself. If you don't know how to compile OpenCV, check out the tutorials HERE and pick the appropriate one for your system.

Tetragramm gravatar imageTetragramm ( 2017-02-03 21:26:14 -0500 )edit

Question Tools

1 follower


Asked: 2017-02-02 02:23:41 -0500

Seen: 988 times

Last updated: Feb 02 '17