I am a beginner in OpenCV, and am trying to extract numbers from a dataset of images and use the extracted numbers as a dataset for NN. For this, I'm using mser's bounding boxes and then cropping the image in size of the bounding box. but mser is not detecting the text area correctly. Please help me on how to do it more precisely. here is my code:
mser = cv2.MSER_create(_delta = 1)
msers, bbs = mser.detectRegions(gray)
Here bbs are the list of bounding boxes, they are not on the text area, not even one.
Image of the ground truth, where the bounding box should be:
Bounding box by mser:
Another example of the bounding box by mser: