lucashmsilva / SimpleLPR

This is a simple LPR system implemented in python using Machine Learning and image processing techniques
GNU General Public License v3.0
2 stars 0 forks source link

Can't segment image #2

Open neilyoung opened 5 months ago

neilyoung commented 5 months ago

First of all: Thanks for sharing.

I was running it under Python 3.10 and found these issues:

>>> TRAININ USING: mlp
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.

Increase the number of iterations (max_iter) or scale the data as shown in:
    https://scikit-learn.org/stable/modules/preprocessing.html
  self.n_iter_ = _check_optimize_result("lbfgs", opt_res, self.max_iter)
>>> FINISHED TRAINING

Other than that: I was successfully predicting with "-a", but not with my own image, like this one or others:

image

I always got Can't segment image for all own images.

EDIT: Came over the mlp training by increasing the limit to 300

neilyoung commented 5 months ago

I also see a possible ambiguity problem for German plates at least.

In your data set you have B EW 742. This is recognized as

BEW742
Local Thresholding, with closing
LABEL:                 BEW742
mlp        PREDICTION: B5W742 
svm_rbf    PREDICTION: BLW742 
sgd        PREDICTION: D5W742 
kneighbors PREDICTION: BEW742 
mlp_adam   PREDICTION: B5W742 
mlp_sgd    PREDICTION: BEW742 
svm_linear PREDICTION: B5W742 

Plain BEW742, without spaces, is simply ambiguous, because it could be a Berlin numberplate (B EW 742) or even a Beckum number plate (BE W 742). And there are many, many other ambiguities in German number plate recognition, if you not even detect the space between the first 1 to 3 letters and the rest.

neilyoung commented 5 months ago

Confused now: Tried this:

python predict.py -t /Users/decades/Documents/tmp/SimpleLPR/imgs/plates/BEW742.png 

and it brought me the same "Can't segment...". But it was OK with python predict -a

neilyoung commented 5 months ago

Oh, that's crazy... You don't really support the provisioning of arbitrary images somewhere in the paths...

I copied my "auto5.png" as "BRD1891.png" into "./imgs/plates" and ran...

 python predict.py -t BRD1891.png

And look what I've got:

Otsu Thresholding, with closing
LABEL:                 BRD1891 
mlp        PREDICTION: 5GD25V2 
svm_rbf    PREDICTION: BRD1B71 
sgd        PREDICTION: BGD2BV1 
kneighbors PREDICTION: BRD1B21 
mlp_adam   PREDICTION: BRD2372 
mlp_sgd    PREDICTION: 5RD23R2 
svm_linear PREDICTION: 5PD2572 

What kind of higher nonsense is this? (besides the fact, that there is not even one correct prediction?)