Open kubasiak opened 4 years ago
I have the same issue how didi you define maxh ?
Instead of : ,cont, = cv2.findContours(binary, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
write : ,cont, = cv2.findContours(binary, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
and everything is fixed!!!!
@eaglemas I'm working with RETR_TREE too currently. Although it can work okay at such scenarios, RETR_TREE might also create extra contours. For example, for digits like 0 since all the contours hierarchy is calculated we might get 2 contours one inside and the other on the external. It would be better if we go with RETR_EXTERNAL and crop the portions of image.
@kubasiak Can you please provide me the optimal code for this issue as I am getting confused by your soluton?
Hi, First of all thank you for this repo. I enjoyed it a lot. I see that there is an issue with the boxes around characters. When using
cv2.findContours
sometimes the contours are not found. I find that it is in large extent because of the frames that are around the plates. I have solved it with removing a margin of 5% from the plate picture. ( Later of course the coordinates of the frames must be adjusted for this margin in respect to the original picture.)It is not the most elegant solution but it helped:
And then of course adjust when cropping images: