KananVyas / BoxDetection

A Box detection algorithm for any image containing boxes.
https://medium.com/@kananvyas/a-box-detection-algorithm-for-any-image-containing-boxes-756c15d7ed26
GNU General Public License v3.0
119 stars 53 forks source link

extracting boxes from tambola ticket failed to separate 8th and 9th column #11

Open thisisnottaken opened 3 years ago

thisisnottaken commented 3 years ago

41 Please see attached image and output is img_final_bin My aim is to extract each box then read a number from it if it is not empty . Can you suggest ?

Thanks.

KananVyas commented 3 years ago

Hey, great problem statement. As you can see the 8th and 9th columns are bit blurry. What you can try is:

  1. Try resizing the kernels for dilation/erosion. Use (3,3) instead of (5,5)
  2. Before applying any processing. lower the brightness of the image.
thisisnottaken commented 3 years ago

After saving my input file as 41.jpg and creating empty Images and Output folder I am simply running

python src\box_detection.py

It seems you are already using 3x3 kernel in your code . I changed it to
kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (5, 5)) but found no difference in output . Can you suggest code change to lower brightness of image ?

Thanks.