License Plate Recognition OpenCV3.1 Application Jacky Le 7Sep2016.

Slides:



Advertisements
Similar presentations
Computer Systems Nat 4/5 Data Representation Lesson 4: Storing Graphics.
Advertisements

THE PROFESSIONAL APPROACH SERIES © 2008 The McGraw-Hill Companies, Inc. All rights reserved. 1 Lesson Objectives Lesson 5 objectives Use a template to.
Copyright © 2012 Pearson Education, Inc. Chapter 11 MORE WINDOWS CONTROLS & STANDARD DIALOG BOXES.
©SIProp Project, How to Make Hand Detector Noritsuna Imamura
Original image: 512 pixels by 512 pixels. Probe is the size of 1 pixel. Picture is sampled at every pixel ( samples taken)
CS 240: Data Structures Supplemental: Command Line Input.
L.
Integrating Microsoft Project with Other Programs
A Tutorial on Object Detection Using OpenCV
Adobe Flash CS4 – Illustrated Unit B: Creating Graphics and Text.
Sudoku Downloader and Recognizer Author: Pedro Evaristo González Sánchez.
Visual C Sharp – File I/O - 1 Variables and arrays only temporary - lost when a program terminates Files used for long term storage (Data bases considered.
File Handling. Data Files Programs that can only get data from the user interface are limited. –data must be entered each time. –only small amounts of.
Lecture 7: WinForms & Controls, Part MicrosoftIntroducing CS using.NETJ# in Visual Studio.NET Objectives “Visual Studio.NET ships with a wealth.
Detect Candle.  Open VC++ Directories configuration: Tools > Options > Projects and Solutions > VC++ Directories  Choose "Show directories for: Include.
Shawlands Academy Higher Computing Data Representation.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
Working with Symbols and Interactivity
L. Akshay Masare Piyush Awasthi IMAGE PROCESSING AND OPENCV.
Open Your Mind to Open Source MPDO’s & EOPR’s Centre for IT & eGovernance AMR-APARD Hyderabad Welcome!
Types of Data. Numbers Text Pictures Sound Video.
Lecture Set 12 Sequential Files and Structures Part A – Dialog Boxes, Filters, Directories.
Introduction of OpenCV Alireza Shirani Researcher of Medical Image and Signal Processing M. S Electrical Engineering yahoo. com Spring.
File Sizes & Storage Requirements.  An image has a width in pixels and a height in pixels  Start by calculating the number of pixels all up  640 x.
Variables When programming it is often necessary to store a value for use later on in the program. A variable is a label given to a location in memory.
Chapter 4 Working with Frames. Align and distribute objects on a page Stack and layer objects Work with graphics frames Work with text frames Chapter.
Quiz # 1 Chapters 1,2, & 3.
Adobe InDesign CS2—Revealed PLACING AND LINKING GRAPHICS.
Introduction to Emgu EE4H, M.Sc Computer Vision Dr. Mike Spann
Variables Art &Technology, 3rd Semester Aalborg University Programming David Meredith
Thai OCR using Template Matching Algorithm By Manoch Pracha Assignment 1.
Copyright © 2012 Pearson Education, Inc. Chapter 5 Loops, File, and Random Numbers.
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
© 2011 Delmar, Cengage Learning Chapter 4 Working with Frames.
Make an Icon in Paint. Open Paint – found under the Accessories menu in Start - Programs Image – Attributes – set the size of the picture to 32 x32 pixels.
 Learn how you can use the shader through OpenGL ES  Add texture on object and make the object have a different look!!
CS100 Final Review Study the quizzes Find out what you missed on the midterms.
HOW SCANNERS WORK A scanner is a device that uses a light source to electronically convert an image into binary data (0s and 1s). This binary data can.
Essential components of the implementation are:  Formation of the network and weight initialization routine  Pixel analysis of images for symbol detection.
Frank Bergschneider February 21, 2014 Presented to National Instruments.
SPREADSHEET 3 Enhancement Features 1Sabbir Saleh_Lecture_18_Computer Application_BBA.
Spreadsheet Enhancement Features Objective 6.02 Enhancement Features.
LOGO FACE DETECTION APPLICATION Member: Vu Hoang Dung Vu Ha Linh Le Minh Tung Nguyen Duy Tan Chu Duy Linh Uong Thanh Ngoc CAPSTONE PROJECT Supervisor:
Things about pattern recognition OGD. Pattern recognition ● Simplify the input ● Extract features ● Process ● Learn? ● Output results.
Text and Images Key Revision Points.
Spreadsheet Enhancement Features
Computer Graphics Presented by: May Lau.
The View Figure Module The View Figure and Figure modules are for FactSage like Notepad and Word for Windows. Use the View Figure module for simple graphical.
Adobe Flash Professional CS5 – Illustrated
ICP Kit HHC Data Validation and Aggregation Module
Mobile App development course project
Binary 4 File Sizes.
Spreadsheet Enhancement Features
Outline Image formats and basic operations Image representation
Images in Binary.
EE 596 Machine Vision HW 6 Assigned: Nov 20, 2013
MDI Picture Viewer Application
Optical Character Recognition
Embedding Graphics in Web Pages
The Assistive System Progress Report 2 Shifali Kumar Bishwo Gurung
funCTIONs and Data Import/Export
Midterm Exam Closed book, notes, computer Similar to test 1 in format:
CS1110 Today: collections.
A Tutorial on Object Detection Using OpenCV
Computer Systems Nat 4/5 Data Representation Lesson 4:
Support vector machine-based text detection in digital video
BASIC 17 Mr. Husch.
CS Problem Solving and Object Oriented Programming Spring 2019
Browser Control Multiple Forms
Presentation transcript:

License Plate Recognition OpenCV3.1 Application Jacky Le 7Sep2016

1. Architect Load img Pre img processing Convert to Binary Draw Rect around object Find the Rect we suspect as License plate Recognize character base on SVM predic Detect License PlateCharacter training Load traning imgs Get feature data Training Save SVM training file

2. GUI

3. Module – SVM Training //Train SVM OpenCV 3.1 definition Ptr svm = SVM::create(); svm->setType(SVM::C_SVC); svm->setKernel(SVM::RBF); svm->setGamma(0.5); svm->setC(16); svm->setTermCriteria(TermCriteria(TermCriteria::MAX_ITER, 100, 1e-6)); vector folders = list_folder(trainImgpath); // FOLDER KEEP The training images Mat src; Mat data = Mat( number_of_sample * number_of_class, number_of_feature, CV_32FC1); Mat label = Mat(number_of_sample * number_of_class, 1, CV_32SC1); dat1, dat2, …. datndat11, dat21, …. datn1 … Label1, label2,……labeln Label Data number_of_feature = 32 number_of_sample * number_of_class = 30*10

3.1 Module – SVM Training/data,label get data for (size_t i = 0; i < folders.size(); ++i) { vector files = list_file(folders.at(i)); string folder_path = folders.at(i); string label_folder = folder_path.substr(folder_path.length() - 1); for (size_t j = 0; j < files.size(); ++j) { src = imread(files.at(j)); vector feature = calculate_feature(src); for (size_t t = 0; t < feature.size(); ++t) {data.at (index, t) = feature.at(t);} label.at (index, 0) = i; index++; } // SVM Train OpenCV 3.1 svm->trainAuto(ml::TrainData::create(data, ml::ROW_SAMPLE, label)); svm->save(savepath); Need to calculate feature for each sample to train

3.2 Module – SVM Training/Feature calculation Example we have 2 character image 0 and 4 We need resize 2 image to same size and divide as 16 small area as picture As you can see we can find difference between 2 image on cell(1,1)(1,4)(2,2)... on those cell total back pixel are difference. This app i used 32 features, we can use more features for the training to get more precision

3.2 Module – SVM Training/Feature calculation Mat img; threshold(src, img, 100, 255, CV_THRESH_BINARY); vector r; //vector cell_pixel; resize(img, img, Size(40, 40)); int h = img.rows/4; int w = img.cols/4; int S = count_pixel(img); int T = img.cols * img.rows; for(int i = 0; i < img.rows; i += h) { for(int j = 0; j < img.cols; j += w) { Mat cell = img(Rect(i,j, h, w)); int s = count_pixel(cell); // get black pixcel float f = (float)s/S; r.push_back(f); }

3.2 Module – SVM Training/Feature calculation for(int i = 0; i < 16; i+= 4) { float f = r[i] + r[i+1] + r[i+2] + r[i+3]; r.push_back(f); } for(int i = 0; i < 4; ++i) { float f = r[i] + r[i+4] + r[i+8] + r[i+ 12]; r.push_back(f); } r.push_back(r[0] + r[5] + r[10] + r[15]); r.push_back(r[3] + r[6] + r[9] + r[12]); r.push_back(r[0] + r[1] + r[4] + r[5]); r.push_back(r[2] + r[3] + r[6] + r[7]); r.push_back(r[8] + r[9] + r[12] + r[13]); r.push_back(r[10] + r[11] + r[14] + r[15]); r.push_back(r[5] + r[6] + r[9] + r[10]); r.push_back(r[0] + r[1] + r[2] + r[3] + r[4] + r[7] + r[8] + r[11] + r[12] + r[13] + r[14] + r[15]);

4. Module – Main/Load image // Load image by dialog OpenFileDialog^ dgOpen = gcnew OpenFileDialog(); dgOpen->Filter = "Image(*.bmp; *.jpg)|*.bmp;*.jpg|All files (*.*)|*.*||"; if (dgOpen->ShowDialog() == System::Windows::Forms::DialogResult::Cancel) return; // assign image to the picture box & srcImage Bitmap^ bmpSrc = gcnew Bitmap(dgOpen->FileName); ptbSrc->Image = bmpSrc; ptbSrc->Refresh(); srcImg = imread(stringTochar.ConvertString2Char(dgOpen->FileName));

4.1 Module – Main/Pre-image process // Preimage processing imageConvert to grayConvert to binary cvtColor(image, gray, CV_BGR2GRAY);adaptiveThreshold(gray, binary, 255, CV_ADAPTIVE_THRESH_GAUSSIAN_C, CV_THRESH_BINARY, 55, 5);

4.2 Module – Main/Find contours and detect the plate // Detect the plate Binary imageFind contoursDetect the plate (base on rect size and ratio findContours(binary, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, cv::Point(0, 0)); findContours(sub_binary, sub_contours, sub_hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, cv::Point(0, 0));

4.3 Module – Main/Recognize character inside ls plate detected // Recognize license plate base on SVM predict // Plate recognition for (size_t i = 0; i < characters.size(); i++) { string result; for (size_t j = 0; j < characters.at(i).size(); ++j) { char cs = character_recognition(characters.at(i).at(j)); result.push_back(cs); } text_recognition.push_back(result); System::String^ str = gcnew System::String(result.c_str()); // Convert std string to System String textBox1->Text += str; }