Python ANPR with OpenCV and EasyOCR in 25 Minutes | Automatic Number Plate Recognition Tutorial

Ғылым және технология

Tired of searching for your Uber?
Trying to get a better idea of who’s stealing your car park?
Just want an awesome Computer Vision project to try out using Python?
Well, ANPR might just be the perfect thing for your to try out! In this video we’ll go through a full blown walkthrough of performing Automatic Number Plate Recognition (ANPR) using OpenCV and EasyOCR. We just edge detection and filtering techniques combined with deep learning powered optical character recognition to be able to extract number plate text from images in just 25 minutes.
In this video you’ll learn how to:
0:00 - Start
5:59 - Reading and visualising images using OpenCV with Python
7:37 - Applying color shifts and changes to images (e.g. grayscaling and BGR2RGB)
9:48 - Detecting contours using OpenCV findCountours
14:32 - Masking number plates to improve text extraction for OCR
18:40 - Extracting number plate text using EasyOCR
GET THE CODE!
github.com/nicknochnack/ANPRw...
Links Mentioned:
Circuit Digest Article: circuitdigest.com/microcontro...
OpenCV Documentation: docs.opencv.org/4.5.0/
EasyOCR: github.com/JaidedAI/EasyOCR
PyTorch: pytorch.org/get-started/locally/
If you have any questions, please drop a comment below!
Oh, and don't forget to connect with me!
LinkedIn: / nicholasrenotte
Facebook: / nickrenotte
GitHub: github.com/nicknochnack
Happy coding!
Nick
P.s. Let me know how you go and drop a comment if you need a hand!

Пікірлер: 381

  • @anthonylwalker
    @anthonylwalker3 жыл бұрын

    Thanks, this has helped simplify a lot of techniques I was getting my head around. Such a great pipeline, and a great tutorial. Keep them up in the same style!

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Thanks so much @Anthony, glad you enjoyed it!

  • @philatkinson8051
    @philatkinson80512 жыл бұрын

    Great video and really good explanation and as for typing that amount of code by hand and it working first time. . . Just amazing.

  • @padynz9869
    @padynz98692 жыл бұрын

    Very lucid and beautifully presented, Nicholas.

  • @user-zj9pq5xc7x
    @user-zj9pq5xc7x7 ай бұрын

    I have mad respect towards you for this. thank you so much

  • @surajprakash4630
    @surajprakash4630 Жыл бұрын

    Thanks man it's working fine...u explains very well

  • @weixiangng8279
    @weixiangng8279 Жыл бұрын

    Great explanation from you Nicholas. Like the method you used.

  • @johanneszwilling
    @johanneszwilling2 жыл бұрын

    😎👍🏼 PERFECT Tutorial!

  • @EduardoAvelar
    @EduardoAvelar3 жыл бұрын

    Amazing approach. Thanks for sharing.

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Thanks so much @Eduardo!

  • @abhinavsingh595
    @abhinavsingh5952 жыл бұрын

    Program is working well, that helped a lot thanks.

  • @abhinavsingh3513

    @abhinavsingh3513

    3 ай бұрын

    Bro please tell me how to install and run the project please

  • @gustavojuantorena
    @gustavojuantorena3 жыл бұрын

    Another great tutorial, Nicholas! 👏👏

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    🙏🙏🙏 thanks so much @Gustavo!!

  • @ChirawatNg
    @ChirawatNg Жыл бұрын

    Great tutorial !!!! Thank you

  • @dharshinir7154
    @dharshinir71542 жыл бұрын

    Clearly explained ....👏

  • @mencychristian1831
    @mencychristian18313 жыл бұрын

    Man you saved my presentation ....thank you so much!

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    YESS, glad I could help @Mency, how did your presentation go?

  • @mencychristian1831

    @mencychristian1831

    3 жыл бұрын

    @@NicholasRenotte That was my best presentation ever 😀

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    @@mencychristian1831 YESSSSS, so glad to hear!!

  • @joshinc6890
    @joshinc68903 жыл бұрын

    Thank you for sharing this great knowledge

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Anytime @Josh, glad you enjoyed it!

  • @01bit
    @01bit3 жыл бұрын

    Great explanation!!!

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Thanks a bunch @01bit, so glad you enjoyed it!

  • @ozlematz2528
    @ozlematz25283 жыл бұрын

    Thank you my teacher. Nice education. ^_^

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    So glad you enjoyed it Özlem!

  • @gangaramyadav6104
    @gangaramyadav61049 ай бұрын

    Really great 👍 thank you 🙂

  • @232nate
    @232nate3 жыл бұрын

    Thank you for the detail

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Glad you enjoyed it @232nate, this is the updated version if you're interested: kzread.info/dash/bejne/YmFo0sGKl9XKkqg.html

  • @sakshishrivastava0210
    @sakshishrivastava02103 жыл бұрын

    Thanks a lot brother🙌

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Anytime @Sakshi!

  • @Knowledge_Wave813
    @Knowledge_Wave8132 жыл бұрын

    Amazing 👍👍

  • @kronos9913
    @kronos99133 жыл бұрын

    Nice thanks bro!

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Thanks so much @Kronos!

  • @ade1963
    @ade19636 ай бұрын

    great, thanks

  • @Dr.AhmedQusaySabri
    @Dr.AhmedQusaySabri2 жыл бұрын

    Thank you

  • @uiuxshoaib
    @uiuxshoaib Жыл бұрын

    Thanks man.

  • @joshuamiranda6688
    @joshuamiranda66883 жыл бұрын

    Amazing!!!!!

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Thanks so much @Joshua!

  • @LuisMunoz-ju2in
    @LuisMunoz-ju2in3 жыл бұрын

    You're amazing. This is the best video and tutorial I've seen. Please create a tutorial to apply Machine Learning to Number Plate Recognition!

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Definitely, going to try for deep learning @Luis!

  • @JH-ms1jv
    @JH-ms1jv3 жыл бұрын

    Hey mate. Great videos. I’ve read through a few comments and pretty excited to see this “new” video ahah. Any idea when it’s going to be released?

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Was smashing it out til late last night @J H, let me know what you think: kzread.info/dash/bejne/YmFo0sGKl9XKkqg.html

  • @ayanokojikiyotaka1923
    @ayanokojikiyotaka1923 Жыл бұрын

    Thanks Man

  • @abdulwaseymohammed9729
    @abdulwaseymohammed9729 Жыл бұрын

    Hi Nicholas, thanks for this video. Could you do another video that shows how to extract hand written text from the Crosswords puzzles and compare that with the correct answers?

  • @rohit_mondal__
    @rohit_mondal__3 жыл бұрын

    thanks sir !...this helped me

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    You're welcome man! So glad it helped!

  • @rohit_mondal__

    @rohit_mondal__

    3 жыл бұрын

    @@NicholasRenotte sir can u please make a video on yolo using keras ?

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    @@rohit_mondal__ will take a look!

  • @manisharya2138
    @manisharya2138 Жыл бұрын

    Please make one more video with great accuracy. This video is also excellent but I test some images on the data sometimes accuracy miss

  • @taruna1918
    @taruna191810 ай бұрын

    Thanks bro))😀😇

  • @AlexShoyhit
    @AlexShoyhit11 ай бұрын

    thank you very helpfull

  • @absormu929
    @absormu9293 жыл бұрын

    Thanks bro Nicholas Renotte....

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Thanks a ton @Absor!

  • @vikashchand.
    @vikashchand.3 жыл бұрын

    Killing it man! 🔥 Can you show how you would turn this into an api and host it maybe?

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    WHADDUP @Vikash! Definitely, have some stuff with Streamlit and FastAPI planned!!

  • @vikashchand.

    @vikashchand.

    3 жыл бұрын

    @@NicholasRenotte sounds awesome man! Looking forward to it!

  • @raymondmichael4987

    @raymondmichael4987

    2 жыл бұрын

    9 months later; asking if you made it bro

  • @teilorlopes1039
    @teilorlopes10392 жыл бұрын

    Great tutorial! What about to implement usign live videos!

  • @sedky69
    @sedky695 ай бұрын

    Great video. Do you have a video on how to incorporate machine learning into this?

  • @ronaktawde
    @ronaktawde3 жыл бұрын

    please make object tracking & counting video on vehicles in opencv & python

  • @Andy-rq6rq
    @Andy-rq6rq3 жыл бұрын

    Awesome vid Nick, surprised you don't have more subs. Any chance of considering doing semantic segmentation, particularly with the human body.

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Thanks so much @Andy, 😅 it's taken a little while but i've really only hit the ground running for a few months now! We'll get there! I've done it with JS (kzread.info/dash/bejne/fXWVusSAopzVYNY.html), Python is defs coming!

  • @Andy-rq6rq

    @Andy-rq6rq

    3 жыл бұрын

    @@NicholasRenotte Wow thanks!

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    @@Andy-rq6rq anytime hombre!

  • @godfreyfonseca5707
    @godfreyfonseca57073 жыл бұрын

    Really amazing,was very helpful. Just wanted to know if there's a way to use an entire dataset of images for this technique? Any tutorial you may know of? Thanks In advance!

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Stay tuned @Godfrey, updated version of this tutorial coming out this week!

  • @godfreyfonseca5707

    @godfreyfonseca5707

    3 жыл бұрын

    @@NicholasRenotte great 😍🙌... looking forward to it!

  • @shukursabzaliev8929
    @shukursabzaliev89292 жыл бұрын

    Amazing intro ))) One question though, can the image size affect findContours functions?

  • @h.kargar71
    @h.kargar712 жыл бұрын

    nice

  • @user-ed7cg1pv5f
    @user-ed7cg1pv5f Жыл бұрын

    Thank you so much for this code! Is there any way to do a performance evaluation of the code?

  • @datapro007
    @datapro0072 жыл бұрын

    Hi, Nick, Great video. I did spend a lot of time on the Tensorflow version of this project that you posted a while back. What do you see as the plusses and minuses of the two different approaches?

  • @NicholasRenotte

    @NicholasRenotte

    2 жыл бұрын

    The TF version is a lot more resilient to different photos of plates. This almost needs to be tuned each time depending on lighting, contrast, hue and sat to be able to effectively pick up the plate each time. However the TF version is wayyyy more compute heavy.

  • @adityagoel2792

    @adityagoel2792

    Жыл бұрын

    @@NicholasRenotte I had the same question. Thanks for clarifying Nick! Keep them coming - you're a GREAT teacher! :)

  • @chazimfikri5986
    @chazimfikri59863 жыл бұрын

    Thx Bro 👍

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Anytime @Chazim!

  • @user-pv3ub2zz1y
    @user-pv3ub2zz1y2 жыл бұрын

    Thank you!!! It is very interesting. I have a question. If the number is compound. And there are 2 rectangular counters? How much I tried, only the last contour defines.

  • @costin2k
    @costin2k Жыл бұрын

    Great video , i want to add to this project real time object detection from webcam. Can you tell me few stepts for that? Thanks in advance :)

  • @ashish.ksingh8765
    @ashish.ksingh87652 жыл бұрын

    Can u make some videos using open cv.... (Problem statement on real life based.. ) And also tere solution.

  • @vonvanmany997
    @vonvanmany997 Жыл бұрын

    Hi Nicholas, Thank You for all the hard work you put into this tutorial, its taught me SO Much.. I have a question about the images you used vs. My own images , yours work fine in the program, but the ones I used doesn't populate any coordinates in the location cell. the properties of your images are: 160KB in sizes, 300dpi, 960x722 (dimensions) and 24 bit depth, my images are: 600KB, 96dpi, 2000x1500, and 24 bit depth, aren't

  • @vonvanmany997

    @vonvanmany997

    Жыл бұрын

    is this the reason why the coordinates aren't population or am I missing something in the code

  • @jaytab3686
    @jaytab36862 жыл бұрын

    Is this one better than the other one?

  • @abrahammathew9783
    @abrahammathew97832 жыл бұрын

    Hi Nick, Great Video!! One question, Is it possible to run this on a mp4 file.

  • @nishkarve
    @nishkarve Жыл бұрын

    Nicholas, great job. How do I apply EasyOCR on a camera stream?

  • @Alpha-mk5qw
    @Alpha-mk5qw2 жыл бұрын

    Are there any videos showing a physical prototype or build with a camera?

  • @jesunahmadushno
    @jesunahmadushno Жыл бұрын

    Hi, whenever i'm trying to import cv2 and other my jupyter kernel The kernel appears to have died. It will restart automatically. do you have any solution?

  • @ajaybhadwal
    @ajaybhadwal3 жыл бұрын

    Amazing Nicholas. I am into ANPR technology. Let me know how we can collaborate.

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Cool stuff @Viaggio!

  • @MrLyasine
    @MrLyasine Жыл бұрын

    thank you for this videos but I found that works only on separated cars I mean when there is only one car in a photo, and also the car doesnt have rectangles in its shape

  • @tejeshwarrajput1679
    @tejeshwarrajput16793 жыл бұрын

    Great video!! i have a doubt can do the same thing by using visual studio code ??

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Sure can, just need to install a Python interpreter into VSC.

  • @mariuszwiesiolek9340
    @mariuszwiesiolek93402 жыл бұрын

    Would it be able to capture at least 2 plates at the same time?

  • @RanjitSingh-rq1qx
    @RanjitSingh-rq1qx Жыл бұрын

    Sir how can we create the front end for this project by using flask.

  • @MaestriiCabanelor
    @MaestriiCabanelor3 жыл бұрын

    please make video when u capture with live camera the plates

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Yup, definitely coming @Seby!

  • @rickieryan3919
    @rickieryan39192 жыл бұрын

    Was just involved in a hit and run... Can you help me uncover the license plate number. should be fun haha

  • @NicholasRenotte

    @NicholasRenotte

    2 жыл бұрын

    Oh no! You should take a look at the super resolution models!

  • @akshitsoni9800
    @akshitsoni98002 жыл бұрын

    Hey bro m facing assert error 251 for drawcontour anu suggestion how to solve it

  • @ahmedhelal920
    @ahmedhelal9202 жыл бұрын

    Hi thanks for this fantastic tutorial , how can we add button to add more than one picture and result convert it to excel ?

  • @NicholasRenotte

    @NicholasRenotte

    2 жыл бұрын

    Check out the new tutorial on the channel!

  • @vishwashehan8441
    @vishwashehan84412 жыл бұрын

    im having a error in reader = easyocr.Reader(['en']) line it says it's detection models an after like 2% it is getting stucked kinda very very slow any idea?

  • @azmijedli743
    @azmijedli7432 жыл бұрын

    haw can i applied on raspberry pi plz for my graduation project

  • @samsrec6060
    @samsrec60602 жыл бұрын

    is it possible to make it as a realtime video detection?

  • @arabe7486
    @arabe74863 ай бұрын

    hi, im like zero of python, im trying to follow step by step but i could not install imutil, i've installed easyocr but here can i find imutil to install? thanks

  • @ngkean9743
    @ngkean9743 Жыл бұрын

    How to make this able to read 7 segment display?

  • @businessgamerprb5398
    @businessgamerprb5398Ай бұрын

    Hi... Great video but the problem is it works only on about 10 percent of images in my data set... On others it either says cannot find contour or just detects wrong contour... I have tried with 400+ images and only got about 40-50 correct results... What should i do... Or is this algorithm not enough??

  • @terryteckliong6108
    @terryteckliong61083 жыл бұрын

    Great tutorial, however, I tried other images but the detection of carplate seems to be off. Any idea why ?

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    This particular model isn't super generalised to different types of plates. Try this model, it's way more performant: kzread.info/dash/bejne/YmFo0sGKl9XKkqg.html

  • @simbarashenyaruwata7740
    @simbarashenyaruwata7740 Жыл бұрын

    Good day, Nicholas can i use opencv contour detection to detect square number plates used in Zimbabwe

  • @yativijay1336
    @yativijay13363 жыл бұрын

    can you please make a video for helmet detection using open cv please

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Heya @Yati, check out the latest video, should give you a walkthrough on how to do it!

  • @C-Krunali
    @C-Krunali Жыл бұрын

    Can I use this code to detect number plate from videos

  • @dhruvdarji7729
    @dhruvdarji77295 ай бұрын

    I import opencv library but kernal automatically close??

  • @Dillil
    @Dillil3 жыл бұрын

    Nice tutorial. Do you know how to recognize the characters without using easy OCR at the last step..? I want to use template matching technique to recognize the characters and i will have to use a dataset for it as well. Is there any tutorials you can point me to if you know..? Would be a huge help thank you.

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Heya @Dil lil, you could also use something like Tesseract or an API? Any reason you can't use Easy OCR?

  • @Dillil

    @Dillil

    3 жыл бұрын

    @@NicholasRenotte It’s for a college project. So I have to train a model.

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    @@Dillil ah got it, I don't really have anything that's built from scratch yet unfortunately!

  • @shauryarakesh8250
    @shauryarakesh82508 ай бұрын

    sir can this be applied in a video MP4?

  • @rahulmanocha4533
    @rahulmanocha4533 Жыл бұрын

    How to get the accuracy of this model

  • @RavnnN
    @RavnnN2 жыл бұрын

    line 28, in new_image = cv2.drawContours(mask, [location], 0,255, -1) error: (-215:Assertion failed) reader.ptr != NULL in function 'cvDrawContours' got this error... can u resolve it?

  • @jumbertparrenas3218
    @jumbertparrenas3218 Жыл бұрын

    Can you help me for that for research paper only..

  • @caryllcarino-lg4fi
    @caryllcarino-lg4fi4 ай бұрын

    how to connect it on raspi camera?

  • @aimenino7285
    @aimenino72852 жыл бұрын

    Hi have a small request in the last step (step 6) for rendering results can you help me how i can add Chinese characters and English on the image

  • @gugasevero76
    @gugasevero76 Жыл бұрын

    Hi body! I run your code on colab. Almost everything perfect but other plate I tryed it recognize letter "I" as "1". There is some update?

  • @nimeshkumar3663
    @nimeshkumar36632 жыл бұрын

    hi, I just wanted to know can I use this model as a Text detection model, will this model be able to recognize text from images.

  • @NicholasRenotte

    @NicholasRenotte

    2 жыл бұрын

    Sure can, check out the drug extraction video I did for PaddleOCR. I show how to do it there.

  • @ygproductions4025
    @ygproductions40253 жыл бұрын

    I want to make a executable file with a GUI for this project. How can I do that? Please help me.

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Check out PySimpleGUI, you could probably wrap the code into something like that!

  • @laponiec
    @laponiec2 жыл бұрын

    All I got after reading the text from the cropped image was an error: \Scripts\venv\lib\site-packages\easyocr\craft_utils.py", line 31, in getDetBoxes_core nLabels, labels, stats, centroids = cv2.connectedComponentsWithStats(text_score_comb.astype(np.uint8), connectivity=4) cv2.error: Unknown C++ exception from OpenCV code

  • @user-tw9oi5bu2k
    @user-tw9oi5bu2k Жыл бұрын

    why other images besides the 4 images provided cant extract the plate number?

  • @nathakritnukulrat3063

    @nathakritnukulrat3063

    Жыл бұрын

    I've got this problem too

  • @kevinwu8015
    @kevinwu80152 жыл бұрын

    How can i use this model with flutter?

  • @jeevan1874
    @jeevan1874 Жыл бұрын

    can this be done on footage?

  • @rizaladhi7066
    @rizaladhi70669 ай бұрын

    please share tutorial how to search number in bulk image folder use free api ocr

  • @hilmeroudijk5991
    @hilmeroudijk5991 Жыл бұрын

    would this work on a raspberry pi? with raspberry pi OS

  • @CBECSamiths
    @CBECSamiths2 жыл бұрын

    please say how to detect vehicle in real time and extract the number plate

  • @pokojowyfreestyle9269
    @pokojowyfreestyle92693 жыл бұрын

    I don't know why, but it works for me only with Porsche, the others have still None on location step. Could you help me and tell on which parts of code should i focus?

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Heya @Pokojowy, walk through each step and ensure you're still detecting the edges appropriately. You might need to play with the Canny algorithm line!

  • @alancunningham7200
    @alancunningham72002 жыл бұрын

    How do you know the registration number of the taxi?

  • @cyril2586
    @cyril2586 Жыл бұрын

    Hello, where can i have the full code?

  • @incredible792
    @incredible792 Жыл бұрын

    I got this error "too many values to unpack (expected 2)" when i did the crop part

  • @amaica01
    @amaica012 жыл бұрын

    I need this in javacv

  • @giggslim4917
    @giggslim49173 жыл бұрын

    Hi nic anyway to edit the code such that it can better detect images of black license plates with white text? (Singaporean License Plate)

  • @NicholasRenotte

    @NicholasRenotte

    3 жыл бұрын

    Heya @Giggs! Try out the new workflow, it's way more accurate and can do different types of plates!

  • @ganeshkumaralamuri3588
    @ganeshkumaralamuri35882 жыл бұрын

    what if there are more than 1 number plate how to detect both?

  • @35_pranotisarjoshi_2b6
    @35_pranotisarjoshi_2b6 Жыл бұрын

    Nich Sir, what if I dont have External Graphics card can it still work?

  • @m02-049
    @m02-04925 күн бұрын

    In my case it is detecting headlights and bumper

Келесі