├── .DS_Store
├── .gitattributes
├── .gitignore
├── .idea
├── License-Plate-Detection.iml
├── dictionaries
│ └── sam.xml
├── inspectionProfiles
│ └── Project_Default.xml
├── misc.xml
├── modules.xml
├── vcs.xml
└── workspace.xml
├── Code
├── BldModel.py
├── Bld_FeatureCrps.py
├── Classify.py
├── Configuration.py
├── Evaluate_models.py
├── LP_Detect_main.py
├── Tools.py
├── __pycache__
│ ├── BldModel.cpython-35.pyc
│ ├── Bld_FeatureCrps.cpython-35.pyc
│ ├── Classify.cpython-35.pyc
│ ├── Configuration.cpython-35.pyc
│ ├── Evaluate_models.cpython-35.pyc
│ ├── Test.cpython-35.pyc
│ └── Tools.cpython-35.pyc
└── z_prac.py
├── DataSet
├── Data-Files
│ ├── images_classify
│ │ ├── Foreign_cars
│ │ │ ├── image_2_classify (1).jpg
│ │ │ ├── image_2_classify (2).jpg
│ │ │ ├── image_2_classify (4).jpg
│ │ │ └── image_2_classify (9).jpg
│ │ ├── Indian_cars
│ │ │ ├── classify_photo (1).jpg
│ │ │ ├── classify_photo (2).jpg
│ │ │ ├── classify_photo (3).jpg
│ │ │ ├── classify_photo (4).jpg
│ │ │ └── classify_photo (5).jpg
│ │ ├── contoured_images_roi
│ │ │ ├── roi_images0014.jpg
│ │ │ ├── roi_images0029.jpg
│ │ │ ├── roi_images0030.jpg
│ │ │ ├── roi_images0031.jpg
│ │ │ ├── roi_images0032.jpg
│ │ │ ├── roi_images0033.jpg
│ │ │ ├── roi_images0034.jpg
│ │ │ ├── roi_images0036.jpg
│ │ │ ├── roi_images0038.jpg
│ │ │ ├── roi_images0039.jpg
│ │ │ ├── roi_images0040.jpg
│ │ │ ├── roi_images0041.jpg
│ │ │ ├── roi_images0042.jpg
│ │ │ └── roi_images0043.jpg
│ │ └── extracted_licenceplate_image
│ │ │ ├── roi_images0019_8.jpg
│ │ │ ├── roi_images0021_21.jpg
│ │ │ ├── roi_images0023_9.jpg
│ │ │ ├── roi_images0026_17.jpg
│ │ │ ├── roi_images0036_28.jpg
│ │ │ ├── roi_images0040_19.jpg
│ │ │ ├── roi_images0040_7.jpg
│ │ │ ├── roi_images0041_31.jpg
│ │ │ ├── roi_images0042_29.jpg
│ │ │ └── roi_images0042_33.jpg
│ ├── images_crossvalidate
│ │ ├── Licence-plate
│ │ │ ├── yes (37).jpg
│ │ │ ├── yes (38).jpg
│ │ │ └── yes (40).jpg
│ │ └── Not-Licence-Plate
│ │ │ ├── no (1).jpg
│ │ │ ├── no (13).jpg
│ │ │ ├── no (14).jpg
│ │ │ ├── no (15).jpg
│ │ │ ├── no (16).jpg
│ │ │ ├── no (2).jpg
│ │ │ ├── no (25).jpg
│ │ │ ├── no (26).jpg
│ │ │ ├── no (27).jpg
│ │ │ ├── no (28).jpg
│ │ │ ├── no (3).jpg
│ │ │ ├── no (37).jpg
│ │ │ ├── no (38).jpg
│ │ │ └── no (4).jpg
│ └── images_train
│ │ ├── Licence-Plate
│ │ ├── yes (31).jpg
│ │ ├── yes (32).jpg
│ │ └── yes (33).jpg
│ │ └── Not-Licence-Plate
│ │ ├── no (5).jpg
│ │ ├── no (6).jpg
│ │ ├── no (7).jpg
│ │ └── no (8).jpg
├── Feature-Model
│ ├── class_train.csv
│ └── feature_train.csv
└── models
│ ├── model_svm_rbf_0_0.pickle
│ ├── model_svm_rbf_0_1.pickle
│ ├── model_svm_rbf_0_10.pickle
│ ├── model_svm_rbf_100_0.pickle
│ ├── model_svm_rbf_100_1.pickle
│ ├── model_svm_rbf_100_10.pickle
│ ├── model_svm_rbf_10_0.pickle
│ ├── model_svm_rbf_10_1.pickle
│ ├── model_svm_rbf_10_10.pickle
│ ├── model_svm_rbf_1_0.pickle
│ ├── model_svm_rbf_1_1.pickle
│ └── model_svm_rbf_1_10.pickle
├── README.md
├── blog.py
├── config-local.conf
├── gradient_calculation.py
└── hist_features_HOG.py
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/.DS_Store
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows image file caches
2 | Thumbs.db
3 | ehthumbs.db
4 |
5 | # Folder config file
6 | Desktop.ini
7 |
8 | # Recycle Bin used on file shares
9 | $RECYCLE.BIN/
10 |
11 | # Windows Installer files
12 | *.cab
13 | *.msi
14 | *.msm
15 | *.msp
16 |
17 | # Windows shortcuts
18 | *.lnk
19 |
20 | # =========================
21 | # Operating System Files
22 | # =========================
23 |
24 | # OSX
25 | # =========================
26 |
27 | .DS_Store
28 | .AppleDouble
29 | .LSOverride
30 |
31 | # Thumbnails
32 | ._*
33 |
34 | # Files that might appear on external disk
35 | .Spotlight-V100
36 | .Trashes
37 |
38 | # Directories potentially created on remote AFP share
39 | .AppleDB
40 | .AppleDesktop
41 | Network Trash Folder
42 | Temporary Items
43 | .apdisk
44 |
--------------------------------------------------------------------------------
/.idea/License-Plate-Detection.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/dictionaries/sam.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 | conf['Train_data1_dir']
115 | Train_data1_dir
116 | reppo
117 | %20
118 | contours
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 | Python
148 |
149 |
150 |
151 |
152 | Python
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 | 1497487516668
330 |
331 |
332 | 1497487516668
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 | file://$PROJECT_DIR$/Code/LP_Detect_main.py
377 | 2
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
--------------------------------------------------------------------------------
/Code/BldModel.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | Created on Thu Mar 19 14:40:18 2015
4 |
5 | @author: Sardhendu_Mishra
6 | """
7 | from __future__ import division
8 |
9 | import copy
10 | from six.moves import cPickle as pickle
11 | import numpy as np
12 | from sklearn.svm import SVC
13 | import Configuration
14 |
15 | from sklearn.svm import LinearSVC
16 | from Bld_FeatureCrps import CrtFeatures
17 |
18 |
19 | #==============================================================================
20 | # Seperate the data into training and test dataset and see the accuracy of
21 | # classifier while classifing the learned models with the segregated test set.
22 | # The segregation will be done only once. So the accuracies can be compared.
23 | #==============================================================================
24 | class SvmModel():
25 |
26 | def understand_gaussian_kernel (self,x,y,sigma):
27 | euclidean_distance=pow((x-y),2)
28 | z=euclidean_distance/(2*(pow(sigma,2)))
29 | f=np.exp(-z)
30 | return f
31 |
32 | def build_kernel(self,x_new,x_orig,sigma):
33 | # using gaussian kernel or rbf would create a m*m dimentional training set so we take one
34 | (m,n)=x_orig.shape
35 | (m_new, n_new)= x_new.shape
36 |
37 | f=np.zeros(shape=(m,m_new))
38 | f_each_row=np.zeros(m)
39 | for i in range(0,m_new):
40 | #print i
41 | l=x_new[i]
42 | #print l
43 | for j in range(0,m):
44 | p=x_orig[j]
45 | euclidean_distance=0
46 | for k in range(0,n):
47 | a=l[k]
48 | b=p[k]
49 | euclidean_distance=euclidean_distance+(pow((b-a),2))
50 | z=euclidean_distance/(2*(pow(sigma,2)));
51 | f_each_row[j]=np.exp(-z);
52 | f[j,i]=f_each_row[j];
53 | return f
54 |
55 | def cal_sigmoid(self, x,theta):
56 | z=np.dot(x,theta) # For matrix multiplication x is [80*3], theta is [3*1]
57 | h= 1 / (1 + np.exp(- z))
58 | return h
59 |
60 | def cal_cost(self, h, y, m):
61 | j_theta= (-np.transpose(y).dot(np.log(h)) - (np.transpose(1-y).dot(np.log(1-h))))
62 | return j_theta
63 |
64 | def cal_grad(self, x,y,h,m):
65 | error =h-y
66 | grad= (np.dot(np.transpose(x), error)) # For matrix multiplication x transpose is [3*80] and y is [80*1]
67 | return grad
68 |
69 | def main_call(self, sigma, x, y,max_iter, alpha, c):
70 | X = self.build_kernel(x,x,sigma)
71 | X = np.insert(X,0,1,axis=1)
72 | (M,N) = X.shape
73 |
74 | theta = np.zeros(shape=(N ,1), dtype='float64')
75 | j_theta = np.zeros(shape=(max_iter,1), dtype='float64')
76 | for num_iter in range(0,max_iter):
77 | h = self.cal_sigmoid(X, theta)
78 | j_reg_term = np.subtract((np.transpose(theta).dot(theta)),pow(theta[0],2))/2
79 | j_theta[num_iter] = (float(c) * self.cal_cost(h,y,M)) + j_reg_term
80 |
81 | grad = self.cal_grad(X,y,h,M)
82 |
83 | grad = c * grad
84 | reg_grad = copy.deepcopy(theta) # After taking the derivative the regularized term become theta
85 | reg_grad[0] = 0
86 | grad = grad+reg_grad
87 |
88 | theta = np.subtract(theta, (np.multiply(alpha , grad)))
89 | #print theta
90 | return X, j_theta,theta
91 |
92 |
93 |
94 |
95 | #==============================================================================
96 | # Classifier for Linear SVC
97 | #==============================================================================
98 | class Models():
99 |
100 | def __init__(self, type = 'rbf'):
101 | self.type = type
102 | self.conf = Configuration.get_datamodel_storage_path()
103 | self.c_range = [0.1,1.0, 10.0, 100.0]#, 1000.0]
104 | self.gamma_range = [0.1, 1, 10.0]
105 | self.kernel="rbf"
106 |
107 | def fit(self, features, labels):
108 | if self.type == 'linear':
109 | # run_linear_SVM(features, labels):
110 | model = LinearSVC(random_state=42)
111 | model.fit(features, labels)
112 | f = open(self.conf["Linear_SVC_dir"] , "wb")
113 | pickle.dumps(model, f)
114 | f.close()
115 |
116 | elif self.type == 'rbf':
117 | c_range = self.c_range
118 | gamma_range = self.gamma_range
119 | kernel = self.kernel
120 |
121 | for c in c_range:
122 | for gamma in gamma_range:
123 | clf = SVC(kernel=kernel, C=c, gamma=gamma, probability=True)
124 | classifier = clf.fit(features,labels)
125 | #print classifier
126 | f = open(self.conf["SVM_RFB_dir"]%(int(c),int(gamma)) , "wb")
127 | pickle.dump(classifier, f)
128 | f.close()
129 |
130 |
--------------------------------------------------------------------------------
/Code/Bld_FeatureCrps.py:
--------------------------------------------------------------------------------
1 | #-------------------------------------------------------------------------------
2 | # Name: Data Preparation
3 | # Purpose:
4 | #
5 | # Author: Sardhendu_Mishra
6 | #
7 | # Created: 08/03/2015
8 | # Copyright: (c) Sardhendu_Mishra 2015
9 | # Licence:
10 | #-------------------------------------------------------------------------------
11 |
12 | '''
13 | About: This code snippet prepares the features. It goes to the file where all the pictures of licence plates and non licence plate are stashed, it then does the following.
14 | 1. Gets each picture one by one
15 | 2. Binarizes the images, resize them, perform morphological operation.
16 | 3. Then calls the HOG method, creates the histogram of gradient for the each image which in our case is the feature to our classifier.
17 | This code snippet also prepares the class labels (1 or 0). 1 for the licence plate images and 0 for the non licence plate images.
18 | '''
19 |
20 | import cv2
21 | import glob
22 | import numpy as np
23 | import mahotas.thresholding
24 | import Tools
25 | from skimage.feature import hog
26 |
27 | import Configuration
28 |
29 | '''
30 | About: The below code is the HOG class that instantiates HOG. HOG is used to create the features that is sent into a logistic regression machine or SVM Machine.
31 | With the use of HOG feature we develop a model or find the optimal theta value which is again used for a new instance to predict the output if the image is a number plate or not number plate
32 | '''
33 |
34 |
35 |
36 |
37 | class HOG:
38 | def __init__(self, orientations = 9, pixelsPerCell = (8, 8),cellsPerBlock = (3, 3), visualise=False, normalize = False):
39 | self.orienations = orientations
40 | self.pixelsPerCell = pixelsPerCell
41 | self.cellsPerBlock = cellsPerBlock
42 | self.visualise = visualise
43 | self.normalize = normalize
44 |
45 | def describe(self, image):
46 | hist , hog_image= hog(image,
47 | orientations = self.orienations,
48 | pixels_per_cell = self.pixelsPerCell,
49 | cells_per_block = self.cellsPerBlock,
50 | visualise= self.visualise)
51 | # normalise = self.normalize)
52 |
53 | return hist, hog_image
54 |
55 |
56 |
57 | #==============================================================================
58 | # Create data set
59 | #==============================================================================
60 |
61 | class CrtFeatures():
62 |
63 | def __init__(self):
64 | self.conf = Configuration.get_datamodel_storage_path()
65 | self.trn_path = [self.conf['Train_data1_dir'],self.conf['Train_data2_dir']]
66 |
67 | def hog_feature(self, image_orig):
68 | # print ('CrtFeature!! hog_feature')
69 | #hog= a_HOG_computation.HOG(orientations=18, pixelsPerCell=(9,9), cellsPerBlock=(3,3), visualise=True, normalize=True)
70 | #hog= a_HOG_computation.HOG(orientations=9, pixelsPerCell=(6,6), cellsPerBlock=(1,1), visualise=True, normalize=True)
71 | hog = HOG(orientations=9, pixelsPerCell=(9,9), cellsPerBlock=(3,3), visualise=True, normalize=True)
72 | # Convert the coloured image into grayscale image
73 | image_resized = Tools.resize(image_orig, width=300)
74 | image_gray = cv2.cvtColor(image_resized, cv2.COLOR_BGR2GRAY)
75 | # Do thresholding
76 | image_thresh = image_gray
77 | T = mahotas.thresholding.otsu(image_gray) # will find an optimal value of T from the image
78 |
79 | image_thresh[image_thresh>T] = 255 # This goes pixel by pixel if the pixel value of the thresh is greater than the optimal value then the color is white
80 | image_thresh[image_thresh=50 and h>=10: # We do not go through all the contours but rectangles that have more probability of being a lisence plate
52 | region_of_interest = image_to_classify[y:y+h,x:x+w]
53 | roi_name_array.append(region_of_interest)
54 | # roi stands for region of interest, we store the array of each image in an stack array to later extract the licence plate from given index
55 | # We save the region of interest into a folder, retrive it and then classify it
56 | cv2.imwrite(self.conf['Regions_of_Intrest']+"roi_images%04i.jpg" %count, region_of_interest)
57 | path_classify_roi = [self.conf['Regions_of_Intrest']+"roi_images%04i.jpg" %count]
58 | # We now create feature set for the Region of Interest as we did formt he training set
59 | roi_feature_array, _ = CrtFeatures().create_features(path_classify_roi)
60 | pred_classify = classifier.predict_proba(roi_feature_array) # path_classify will basically contain one image
61 | pred_image_name=("roi_images%04i.jpg" %count)
62 | pred_classify_all[pred_image_name] = pred_classify[0]
63 | count += 1
64 | return pred_classify_all
65 |
66 |
67 |
--------------------------------------------------------------------------------
/Code/Configuration.py:
--------------------------------------------------------------------------------
1 | """
2 | Created on Tue Jan 5 13:35:56 2016
3 |
4 | @author: sardendhu
5 | """
6 |
7 | import os
8 | import configparser as ConfigParser
9 |
10 |
11 | def get_config_dir():
12 | dir_name = os.path.dirname(os.path.abspath(__file__))
13 | dir_name = os.path.abspath(os.path.join(dir_name, os.pardir))
14 |
15 | conf_name = 'config-local.conf'
16 | dir_name = os.path.join(dir_name, conf_name)
17 | # print 'The directory where the config file is: ', dir_name
18 | return dir_name
19 |
20 |
21 | def get_config():
22 | Config = ConfigParser.ConfigParser()
23 | Config.read(get_config_dir())
24 | # print ('All the configuration are: ', Config.sections())
25 | return Config
26 |
27 |
28 | def get_datamodel_storage_path():
29 | curr_dir = os.path.dirname(os.path.abspath(__file__))
30 | curr_dir = os.path.abspath(os.path.join(curr_dir, os.pardir))
31 | curr_dir = os.path.abspath(os.path.join(curr_dir, os.pardir))
32 | curr_dir = os.path.abspath(os.path.join(curr_dir, os.pardir))
33 | # print (curr_dir)
34 |
35 | conf = get_config()
36 |
37 | config_settings = {}
38 | config_settings["Train_data1_dir"] = curr_dir+'/'+conf.get("Dataset", "Train_data1")
39 | config_settings["Train_data2_dir"] = curr_dir+'/'+conf.get("Dataset", "Train_data2")
40 | config_settings["Valid_data1_dir"] = curr_dir+'/'+conf.get("Dataset", "Valid_data1")
41 | config_settings["Valid_data2_dir"] = curr_dir+'/'+conf.get("Dataset", "Valid_data2")
42 |
43 | config_settings["Data_feature_dir"] = curr_dir+'/'+conf.get("Feature-Labels", "Data_feature")
44 | config_settings["Class_labels_dir"] = curr_dir+'/'+conf.get("Feature-Labels", "Class_labels")
45 | config_settings["Data_feature_KernelCnvtd_dir"] = curr_dir+'/'+conf.get("Feature-Labels", "Data_feature_KernelCnvtd")
46 | config_settings["Data_feature_KernelCnvtd_tst_dir"] = curr_dir+'/'+conf.get("Feature-Labels", "Data_feature_KernelCnvtd_tst")
47 | config_settings["Theta_val_dir"] = curr_dir+'/'+conf.get("Feature-Labels", "Theta_val")
48 |
49 | config_settings["Linear_SVC_dir"] = curr_dir+'/'+conf.get("Models", "Linear_SVC")
50 | config_settings["SVM_RFB_dir"] = curr_dir+'/'+conf.get("Models","SVM_RFB")+'model_svm_rbf_%i_%i.pickle'
51 | config_settings["Models"] = curr_dir+'/'+conf.get("Models", "models")
52 |
53 | config_settings["Regions_of_Intrest"] = curr_dir+'/'+conf.get("Contored_images", "Regions_of_Intrest")
54 | config_settings["Classified_license_plates"] = curr_dir+'/'+conf.get("Classified_License_plates", "classified_license_plate")
55 |
56 | config_settings["Indian_cars"] = curr_dir+'/'+conf.get("Images_to_classify","Indian_cars")
57 | config_settings["Foreign_cars"] = curr_dir+'/'+conf.get("Images_to_classify","Foreign_cars")
58 |
59 | return config_settings
60 |
61 |
62 | # print (get_config_dir())
63 | # print (get_datamodel_storage_path())
--------------------------------------------------------------------------------
/Code/Evaluate_models.py:
--------------------------------------------------------------------------------
1 | #-------------------------------------------------------------------------------
2 | # Name: module1
3 | # Purpose:
4 | #
5 | # Author: Sardhendu_Mishra
6 | #
7 | # Created: 15/02/2015
8 | # Copyright: (c) Sardhendu_Mishra 2015
9 | # Licence:
10 | #-------------------------------------------------------------------------------
11 |
12 | import os
13 | import glob
14 | import numpy as np
15 | from six.moves import cPickle as pickle
16 |
17 |
18 | import Configuration
19 | from Bld_FeatureCrps import CrtFeatures
20 | from BldModel import SvmModel
21 |
22 |
23 |
24 | #==============================================================================
25 | # Model 1: Opening the saved model and making prediction on test data using the model
26 | #==============================================================================
27 |
28 |
29 | class Eval():
30 | def __init__(self):
31 | self.conf = Configuration.get_datamodel_storage_path()
32 |
33 | def test_using_model_rbf(self, feature_test):
34 | # Testing the test data precision with all the models with different value of paramter
35 | dict_models = {}
36 | for files in glob.glob(self.conf['Models']):
37 | file_name = os.path.basename(files)
38 | classifier = pickle.load(open(files, 'rb'))
39 | test_classify = classifier.predict(feature_test)
40 | dict_models[file_name] = test_classify
41 | return dict_models
42 |
43 |
44 | def test_using_model_self(self, feature_test):
45 | feature_train = np.genfromtxt(Data_feature_dir, delimiter=',')
46 | theta = np.genfromtxt(Theta_val_dir, delimiter=',')
47 |
48 | sigma=10
49 | feature_test_kernel_cnvrtd = SvmModel().build_kernel(feature_test,feature_train,sigma)
50 | feature_test_kernel_cnvrtd = np.insert(feature_test_kernel_cnvrtd,0,1,axis=0)
51 | feature_test_kernel_cnvrtd = np.transpose(feature_test_kernel_cnvrtd)
52 | prediction = SvmModel().cal_sigmoid(feature_test_kernel_cnvrtd, theta)
53 | np.savetxt(self.conf['Data_feature_KernelCnvtd_tst_dir'], feature_test_kernel_cnvrtd, delimiter=",")
54 | print (prediction)
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Code/LP_Detect_main.py:
--------------------------------------------------------------------------------
1 | from __future__ import division
2 |
3 | import os, glob
4 | import numpy as np
5 | import cv2
6 | import Tools
7 |
8 | import Configuration
9 | from six.moves import cPickle as pickle
10 | from sklearn.metrics import accuracy_score
11 |
12 | from Classify import Classify
13 | from Evaluate_models import Eval
14 | from BldModel import SvmModel, Models
15 | from Bld_FeatureCrps import CrtFeatures
16 |
17 | from shutil import copyfile
18 |
19 |
20 |
21 | conf = Configuration.get_datamodel_storage_path()
22 |
23 |
24 | #==============================================================================
25 | # 1: create and store features and labels of the images: (use Bld_FeatureCrps)
26 | #==============================================================================
27 | def create_feature_matrix():
28 | CrtFeatures().create_training_feature(store='Yes')
29 |
30 |
31 | #==============================================================================
32 | # 2: Train the model and store it into disk for future use.
33 | #==============================================================================
34 |
35 | # Read the features stored in the disk
36 | def train_model():
37 | features = np.genfromtxt(conf['Data_feature_dir'], dtype=float, delimiter=',')
38 | labels = np.genfromtxt(conf['Class_labels_dir'], dtype=float, delimiter=',')
39 |
40 | sigma=4
41 | max_iter=5000
42 | alpha=0.003
43 | c=10
44 |
45 | '''
46 | MODEL 1: find the Kernel cnvrt features, cost_function and Parameters (thetas) and store them as models
47 | Note:
48 | The more the sigma is the less the gamma will be
49 | '''
50 | # features_krnl_cnvrt,j_theta, theta = SvmModel().main_call(sigma, features, labels, max_iter, alpha, c)
51 | # np.savetxt(conf["Data_feature_KernelCnvtd_dir"], features_krnl_cnvrt, delimiter=",")
52 | # np.savetxt(conf["Theta_val_dir"], theta, delimiter=",")
53 |
54 | # '''
55 | # MODEL 2: Use packages models, linearSvc, and rbf's with varying gamma and c values.
56 | # '''
57 | Models(type = 'rbf').fit(features, labels)
58 |
59 |
60 |
61 |
62 | # #==============================================================================
63 | # # 3: Use the patameters and Operate on cross validation dataset
64 | # #==============================================================================
65 |
66 | def valid(inp_path, model=None):
67 | feature_valid, _ = CrtFeatures().create_features(inp_path)
68 | feature_matrix_valid = np.array(feature_valid, dtype="float64")
69 | if model=='rbf':
70 | prediction_dict = Eval().test_using_model_rbf(feature_matrix_valid)
71 | elif model=='self':
72 | prediction_dict = Eval().test_using_model_self(feature_matrix_valid)
73 | else:
74 | print ('You should specify the model in which you would wanna crossvalidate your data')
75 | return prediction_dict
76 |
77 | def run_cross_valid():
78 | valid_path_LP = [conf['Valid_data1_dir']]
79 | valid_path_non_LP = [conf['Valid_data2_dir']]
80 | for no, path in enumerate([valid_path_LP, valid_path_non_LP]):
81 | print ('Running classification no validation file %s: '%path)
82 | prediction_dict = valid(inp_path=path, model='rbf')
83 | for model, pred in prediction_dict.items():
84 | if no==0:
85 | labels_valid = np.ones(len(pred))
86 | elif no==1:
87 | labels_valid = np.zeros(len(pred))
88 | accuracy=accuracy_score(labels_valid, pred)
89 | print ('The accuracy of model %s is: '%model, accuracy)
90 |
91 |
92 |
93 |
94 | # ####################`
95 | # #==============================================================================
96 | # # 4: Find the Number plates of the vehicle
97 | # #==============================================================================
98 | # image_to_classify = "../image_2_classify (11).jpg"
99 |
100 | # For classification let us use models one after another.
101 | # For the cross validation data set the best model was. model_svm_rbf_10_1
102 |
103 |
104 | def Extract_lisenceplate(model, license_plate_path):
105 | for num, image_inp in enumerate(glob.glob(conf['Indian_cars']) + glob.glob(conf['Foreign_cars'])):
106 | print (image_inp)
107 | image_to_classify = cv2.imread(image_inp)
108 | # cv2.imshow('image',image_to_classify)
109 | # cv2.waitKey(0)
110 | # cv2.destroyAllWindows()
111 | image_resized = Tools.resize(image_to_classify, height=500)
112 | pred_dict = Classify().classify_new_instance(image_resized,model)
113 | # print (pred_dict)
114 |
115 | # print (model)
116 | probs = []
117 | for image_fname, prob in pred_dict.items():#range(0,len(pred_dict)):
118 | probs.append(prob[1])
119 | # print (image_fname)
120 | probs = np.array(probs)
121 | ind = np.where(probs == np.max(probs))[0]
122 |
123 | print (ind)
124 |
125 | for filename in np.array(list(pred_dict.keys()))[ind]:
126 | copyfile(conf['Regions_of_Intrest']+filename, license_plate_path+filename.split(".")[0]+"_"+str(num)+".jpg")
127 | # break
128 |
129 |
130 |
131 |
132 | __main__ = True
133 |
134 | if __main__:
135 |
136 | model_path = os.path.dirname(os.path.abspath(conf["SVM_RFB_dir"]))
137 | license_plate_path = conf["Classified_license_plates"]
138 | model = pickle.load(open(model_path+"/model_svm_rbf_1_1.pickle", 'rb'))
139 | # print (license_plate_path)
140 |
141 |
142 | create_feature_matrix()
143 | train_model()
144 | run_cross_valid()
145 | Extract_lisenceplate(model, license_plate_path)
146 |
--------------------------------------------------------------------------------
/Code/Tools.py:
--------------------------------------------------------------------------------
1 | #-------------------------------------------------------------------------------
2 | # Name: module1
3 | # Purpose:
4 | #
5 | # Author: Sardhendu_Mishra
6 | #
7 | # Created: 10/02/2015
8 | # Copyright: (c) Sardhendu_Mishra 2015
9 | # Licence:
10 | #-------------------------------------------------------------------------------
11 |
12 | import numpy as np
13 | import cv2
14 |
15 | def translate(image, x, y):
16 | M=np.float32([[1,0,x],[0,1,y]])
17 | # M is defined as the floating point array because cv2 expects the matrix to be in floting point array
18 | # The first array [1,0,x] indicates the number of pixels to shift right, A negative x would shift x pixels left
19 | # The second array [0,1,y] indicates the number of pixels to shift down, A negative y would shift the image y pixels up
20 | shifted=cv2.warpAffine(image, M, (image.shape[1], image.shape[0]))
21 | # The first argument to the warpAffine function is the image
22 | # The second argument to the warpAffine function is the array by which the image has to shift
23 | # The third argument is the dimension in (height and width), by default the image is stored in (weidth * height) but opencv takes dimension in (height * weidth) format
24 | return shifted
25 |
26 | def rotate(image, angle, center = None, scale=1.0):
27 | # The arguments are :
28 | '''
29 | 1. The image
30 | 2. the angle by which you want to rotate
31 | 3. The center from which you want to rotate, The default is None, when None then we define the center
32 | 4. scale=1.0 by default, It states that
33 | '''
34 | (h,w)= image.shape[:2]
35 |
36 | # When the center is None then we define the center from which the rotation is to be done
37 | if center is None:
38 | center=(w/2, h/2)
39 |
40 | M=cv2.getRotationMatrix2D(center, angle, scale)
41 | rotated= cv2.warpAffine(image, M, (w,h))
42 |
43 | return rotated
44 |
45 |
46 | def resize(image, width= None, height = None, inter=cv2.INTER_AREA):
47 | dim=None
48 | (h,w)= image.shape[:2] # numpy array stores images in (height, width) array, but cv2 uses images in order (width, height) order
49 |
50 | if width is None and height is None: # when no resizing occur
51 | return image
52 |
53 | if width is None: # when resized height is passed and width is not then we calculate the aspect ratio of the weidth
54 | r= height / float(h)
55 | dim=(int(w * r), height) # height is the resized hieght
56 | elif height is None: # When resized width is passed and hieght is not then we calculate the aspect ratio for the height
57 | r= width / float(w)
58 | dim=(width , int(h * r))
59 | else: # when both width and height ratio are provided
60 | dim=(width, height)
61 |
62 | resized= cv2.resize(image, dim, interpolation=inter)
63 | # the third argument hold an algorithm in cv2 defined to resize the image
64 | # we can also use other algorithm like cv2.INTER_LINEAR, cv2.INTER_CUBIC, and cv2.INTER_NEAREST.
65 |
66 | return resized
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/Code/__pycache__/BldModel.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/Code/__pycache__/BldModel.cpython-35.pyc
--------------------------------------------------------------------------------
/Code/__pycache__/Bld_FeatureCrps.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/Code/__pycache__/Bld_FeatureCrps.cpython-35.pyc
--------------------------------------------------------------------------------
/Code/__pycache__/Classify.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/Code/__pycache__/Classify.cpython-35.pyc
--------------------------------------------------------------------------------
/Code/__pycache__/Configuration.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/Code/__pycache__/Configuration.cpython-35.pyc
--------------------------------------------------------------------------------
/Code/__pycache__/Evaluate_models.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/Code/__pycache__/Evaluate_models.cpython-35.pyc
--------------------------------------------------------------------------------
/Code/__pycache__/Test.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/Code/__pycache__/Test.cpython-35.pyc
--------------------------------------------------------------------------------
/Code/__pycache__/Tools.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/Code/__pycache__/Tools.cpython-35.pyc
--------------------------------------------------------------------------------
/Code/z_prac.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | Created on Sat Mar 21 01:05:19 2015
4 |
5 | @author: Sardhendu_Mishra
6 | """
7 |
8 | import cv2.cv as cv
9 | # interface opencv versi 2
10 | import numpy as np
11 | import cv2
12 |
13 |
14 | def calc_hog(im,numorient=9,cellSize=(8,8)):
15 | ihog = calc_hog_base(im, numorient)
16 | return calc_hog_cells(ihog, numorient, cellSize)
17 |
18 |
19 | def preprocess(img):
20 | # gamma correction 1/4 followed by contrast boost (histogram equalization)
21 | return cv2.equalizeHist((np.power(img/255., 0.25)*255).astype(np.uint8))
22 |
23 | def calc_hog_base(im, numorient=9):
24 | # calculate gradient using sobel operator
25 | gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
26 |
27 | gray = preprocess(gray) #preprocess gray image before calculating gradient
28 |
29 | gx = cv2.Sobel(gray, cv2.CV_32F, 1, 0)
30 | gy = cv2.Sobel(gray, cv2.CV_32F, 0, 1)
31 |
32 | # calculate gradient magnitude
33 | """
34 | #mag = np.sqrt(gx*gx+gy*gy)
35 | mag
36 | """
37 |
38 | # calculate gradient orientation and discretize to numorient values
39 | mid = numorient/2
40 |
41 | hog = np.zeros((im.shape[0], im.shape[1], numorient))
42 |
43 |
44 | """
45 | mid = numorient/2
46 | for y in xrange(0, im.shape[0]-1):
47 | for x in xrange(0, im.shape[1]-1):
48 | angle = int(round(mid*np.arctan2(gy[y,x], gx[y,x])/np.pi))+mid
49 | magnitude = np.sqrt(gx[y,x]*gx[y,x]+gy[y,x]*gy[y,x])
50 | hog[y,x,angle] += magnitude
51 |
52 |
53 | """
54 | magor = mid+(mid*np.arctan2(gy, gx)/np.pi).astype(np.uint32)
55 |
56 | #print (magor.min(), magor.max()+1)
57 |
58 | # calculate hog in pixels by grouping each pixel based on gradient orientation
59 |
60 | for orien in xrange(magor.min(), magor.max()+1):
61 | mask = magor==orien
62 | hog[:,:,orien][mask] = mag[mask] + magor[mask]
63 |
64 |
65 | # calculate integral hog
66 | #ihog = cv2.integral(hog)
67 |
68 | return gray,gx,gy,mag,magor,hog
69 |
70 | gray,gx,gy,mag,magor,hog=calc_hog_base(image)
71 |
72 | cv2.imshow("gray", gray)
73 | cv2.imshow("gx", gx)
74 | cv2.imshow("gy", gy)
75 | cv2.waitKey(0)
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/Foreign_cars/image_2_classify (1).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/Foreign_cars/image_2_classify (1).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/Foreign_cars/image_2_classify (2).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/Foreign_cars/image_2_classify (2).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/Foreign_cars/image_2_classify (4).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/Foreign_cars/image_2_classify (4).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/Foreign_cars/image_2_classify (9).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/Foreign_cars/image_2_classify (9).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/Indian_cars/classify_photo (1).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/Indian_cars/classify_photo (1).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/Indian_cars/classify_photo (2).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/Indian_cars/classify_photo (2).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/Indian_cars/classify_photo (3).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/Indian_cars/classify_photo (3).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/Indian_cars/classify_photo (4).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/Indian_cars/classify_photo (4).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/Indian_cars/classify_photo (5).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/Indian_cars/classify_photo (5).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0014.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0014.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0029.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0029.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0030.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0030.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0031.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0031.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0032.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0032.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0033.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0033.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0034.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0034.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0036.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0036.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0038.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0038.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0039.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0039.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0040.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0040.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0041.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0041.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0042.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0042.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0043.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/contoured_images_roi/roi_images0043.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0019_8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0019_8.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0021_21.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0021_21.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0023_9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0023_9.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0026_17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0026_17.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0036_28.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0036_28.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0040_19.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0040_19.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0040_7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0040_7.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0041_31.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0041_31.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0042_29.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0042_29.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0042_33.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_classify/extracted_licenceplate_image/roi_images0042_33.jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Licence-plate/yes (37).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Licence-plate/yes (37).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Licence-plate/yes (38).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Licence-plate/yes (38).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Licence-plate/yes (40).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Licence-plate/yes (40).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (1).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (1).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (13).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (13).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (14).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (14).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (15).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (15).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (16).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (16).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (2).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (2).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (25).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (25).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (26).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (26).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (27).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (27).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (28).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (28).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (3).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (3).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (37).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (37).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (38).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (38).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (4).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_crossvalidate/Not-Licence-Plate/no (4).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_train/Licence-Plate/yes (31).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_train/Licence-Plate/yes (31).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_train/Licence-Plate/yes (32).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_train/Licence-Plate/yes (32).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_train/Licence-Plate/yes (33).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_train/Licence-Plate/yes (33).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_train/Not-Licence-Plate/no (5).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_train/Not-Licence-Plate/no (5).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_train/Not-Licence-Plate/no (6).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_train/Not-Licence-Plate/no (6).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_train/Not-Licence-Plate/no (7).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_train/Not-Licence-Plate/no (7).jpg
--------------------------------------------------------------------------------
/DataSet/Data-Files/images_train/Not-Licence-Plate/no (8).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/Data-Files/images_train/Not-Licence-Plate/no (8).jpg
--------------------------------------------------------------------------------
/DataSet/Feature-Model/class_train.csv:
--------------------------------------------------------------------------------
1 | 1.000000000000000000e+00
2 | 1.000000000000000000e+00
3 | 1.000000000000000000e+00
4 | 1.000000000000000000e+00
5 | 1.000000000000000000e+00
6 | 1.000000000000000000e+00
7 | 1.000000000000000000e+00
8 | 1.000000000000000000e+00
9 | 1.000000000000000000e+00
10 | 1.000000000000000000e+00
11 | 1.000000000000000000e+00
12 | 1.000000000000000000e+00
13 | 1.000000000000000000e+00
14 | 1.000000000000000000e+00
15 | 1.000000000000000000e+00
16 | 1.000000000000000000e+00
17 | 1.000000000000000000e+00
18 | 1.000000000000000000e+00
19 | 1.000000000000000000e+00
20 | 1.000000000000000000e+00
21 | 1.000000000000000000e+00
22 | 1.000000000000000000e+00
23 | 1.000000000000000000e+00
24 | 1.000000000000000000e+00
25 | 1.000000000000000000e+00
26 | 1.000000000000000000e+00
27 | 1.000000000000000000e+00
28 | 1.000000000000000000e+00
29 | 1.000000000000000000e+00
30 | 1.000000000000000000e+00
31 | 1.000000000000000000e+00
32 | 1.000000000000000000e+00
33 | 1.000000000000000000e+00
34 | 1.000000000000000000e+00
35 | 1.000000000000000000e+00
36 | 1.000000000000000000e+00
37 | 1.000000000000000000e+00
38 | 1.000000000000000000e+00
39 | 1.000000000000000000e+00
40 | 1.000000000000000000e+00
41 | 1.000000000000000000e+00
42 | 1.000000000000000000e+00
43 | 1.000000000000000000e+00
44 | 1.000000000000000000e+00
45 | 1.000000000000000000e+00
46 | 1.000000000000000000e+00
47 | 1.000000000000000000e+00
48 | 0.000000000000000000e+00
49 | 0.000000000000000000e+00
50 | 0.000000000000000000e+00
51 | 0.000000000000000000e+00
52 | 0.000000000000000000e+00
53 | 0.000000000000000000e+00
54 | 0.000000000000000000e+00
55 | 0.000000000000000000e+00
56 | 0.000000000000000000e+00
57 | 0.000000000000000000e+00
58 | 0.000000000000000000e+00
59 | 0.000000000000000000e+00
60 | 0.000000000000000000e+00
61 | 0.000000000000000000e+00
62 | 0.000000000000000000e+00
63 | 0.000000000000000000e+00
64 | 0.000000000000000000e+00
65 | 0.000000000000000000e+00
66 | 0.000000000000000000e+00
67 | 0.000000000000000000e+00
68 | 0.000000000000000000e+00
69 | 0.000000000000000000e+00
70 | 0.000000000000000000e+00
71 | 0.000000000000000000e+00
72 | 0.000000000000000000e+00
73 | 0.000000000000000000e+00
74 | 0.000000000000000000e+00
75 | 0.000000000000000000e+00
76 | 0.000000000000000000e+00
77 | 0.000000000000000000e+00
78 | 0.000000000000000000e+00
79 | 0.000000000000000000e+00
80 | 0.000000000000000000e+00
81 | 0.000000000000000000e+00
82 | 0.000000000000000000e+00
83 | 0.000000000000000000e+00
84 | 0.000000000000000000e+00
85 | 0.000000000000000000e+00
86 | 0.000000000000000000e+00
87 | 0.000000000000000000e+00
88 | 0.000000000000000000e+00
89 | 0.000000000000000000e+00
90 | 0.000000000000000000e+00
91 | 0.000000000000000000e+00
92 | 0.000000000000000000e+00
93 | 0.000000000000000000e+00
94 | 0.000000000000000000e+00
95 | 0.000000000000000000e+00
96 | 0.000000000000000000e+00
97 | 0.000000000000000000e+00
98 | 0.000000000000000000e+00
99 | 0.000000000000000000e+00
100 | 0.000000000000000000e+00
101 | 0.000000000000000000e+00
102 | 0.000000000000000000e+00
103 | 0.000000000000000000e+00
104 | 0.000000000000000000e+00
105 | 0.000000000000000000e+00
106 | 0.000000000000000000e+00
107 | 0.000000000000000000e+00
108 | 0.000000000000000000e+00
109 | 0.000000000000000000e+00
110 | 0.000000000000000000e+00
111 | 0.000000000000000000e+00
112 | 0.000000000000000000e+00
113 | 0.000000000000000000e+00
114 | 0.000000000000000000e+00
115 | 0.000000000000000000e+00
116 | 0.000000000000000000e+00
117 | 0.000000000000000000e+00
118 | 0.000000000000000000e+00
119 | 0.000000000000000000e+00
120 | 0.000000000000000000e+00
121 | 0.000000000000000000e+00
122 | 0.000000000000000000e+00
123 | 0.000000000000000000e+00
124 | 0.000000000000000000e+00
125 | 0.000000000000000000e+00
126 | 0.000000000000000000e+00
127 | 0.000000000000000000e+00
128 | 0.000000000000000000e+00
129 | 0.000000000000000000e+00
130 | 0.000000000000000000e+00
131 | 0.000000000000000000e+00
132 | 0.000000000000000000e+00
133 | 0.000000000000000000e+00
134 | 0.000000000000000000e+00
135 | 0.000000000000000000e+00
136 | 0.000000000000000000e+00
137 | 0.000000000000000000e+00
138 | 0.000000000000000000e+00
139 | 0.000000000000000000e+00
140 | 0.000000000000000000e+00
141 | 0.000000000000000000e+00
142 | 0.000000000000000000e+00
143 | 0.000000000000000000e+00
144 | 0.000000000000000000e+00
145 | 0.000000000000000000e+00
146 | 0.000000000000000000e+00
147 | 0.000000000000000000e+00
148 | 0.000000000000000000e+00
149 | 0.000000000000000000e+00
150 | 0.000000000000000000e+00
151 | 0.000000000000000000e+00
152 | 0.000000000000000000e+00
153 | 0.000000000000000000e+00
154 | 0.000000000000000000e+00
155 | 0.000000000000000000e+00
156 | 0.000000000000000000e+00
157 | 0.000000000000000000e+00
158 | 0.000000000000000000e+00
159 | 0.000000000000000000e+00
160 | 0.000000000000000000e+00
161 | 0.000000000000000000e+00
162 | 0.000000000000000000e+00
163 | 0.000000000000000000e+00
164 | 0.000000000000000000e+00
165 | 0.000000000000000000e+00
166 | 0.000000000000000000e+00
167 | 0.000000000000000000e+00
168 | 0.000000000000000000e+00
169 | 0.000000000000000000e+00
170 | 0.000000000000000000e+00
171 | 0.000000000000000000e+00
172 | 0.000000000000000000e+00
173 | 0.000000000000000000e+00
174 | 0.000000000000000000e+00
175 | 0.000000000000000000e+00
176 | 0.000000000000000000e+00
177 | 0.000000000000000000e+00
178 | 0.000000000000000000e+00
179 | 0.000000000000000000e+00
180 | 0.000000000000000000e+00
181 | 0.000000000000000000e+00
182 | 0.000000000000000000e+00
183 | 0.000000000000000000e+00
184 | 0.000000000000000000e+00
185 | 0.000000000000000000e+00
186 | 0.000000000000000000e+00
187 | 0.000000000000000000e+00
188 | 0.000000000000000000e+00
189 | 0.000000000000000000e+00
190 | 0.000000000000000000e+00
191 | 0.000000000000000000e+00
192 | 0.000000000000000000e+00
193 | 0.000000000000000000e+00
194 | 0.000000000000000000e+00
195 | 0.000000000000000000e+00
196 | 0.000000000000000000e+00
197 | 0.000000000000000000e+00
198 | 0.000000000000000000e+00
199 | 0.000000000000000000e+00
200 | 0.000000000000000000e+00
201 | 0.000000000000000000e+00
202 | 0.000000000000000000e+00
203 | 0.000000000000000000e+00
204 | 0.000000000000000000e+00
205 | 0.000000000000000000e+00
206 | 0.000000000000000000e+00
207 | 0.000000000000000000e+00
208 | 0.000000000000000000e+00
209 | 0.000000000000000000e+00
210 | 0.000000000000000000e+00
211 | 0.000000000000000000e+00
212 | 0.000000000000000000e+00
213 | 0.000000000000000000e+00
214 | 0.000000000000000000e+00
215 | 0.000000000000000000e+00
216 | 0.000000000000000000e+00
217 | 0.000000000000000000e+00
218 | 0.000000000000000000e+00
219 | 0.000000000000000000e+00
220 | 0.000000000000000000e+00
221 | 0.000000000000000000e+00
222 | 0.000000000000000000e+00
223 | 0.000000000000000000e+00
224 | 0.000000000000000000e+00
225 | 0.000000000000000000e+00
226 | 0.000000000000000000e+00
227 | 0.000000000000000000e+00
228 | 0.000000000000000000e+00
229 | 0.000000000000000000e+00
230 | 0.000000000000000000e+00
231 | 0.000000000000000000e+00
232 | 0.000000000000000000e+00
233 | 0.000000000000000000e+00
234 | 0.000000000000000000e+00
235 | 0.000000000000000000e+00
236 | 0.000000000000000000e+00
237 | 0.000000000000000000e+00
238 | 0.000000000000000000e+00
239 | 0.000000000000000000e+00
240 | 0.000000000000000000e+00
241 | 0.000000000000000000e+00
242 | 0.000000000000000000e+00
243 | 0.000000000000000000e+00
244 | 0.000000000000000000e+00
245 | 0.000000000000000000e+00
246 | 0.000000000000000000e+00
247 | 0.000000000000000000e+00
248 | 0.000000000000000000e+00
249 | 0.000000000000000000e+00
250 | 0.000000000000000000e+00
251 | 0.000000000000000000e+00
252 | 0.000000000000000000e+00
253 | 0.000000000000000000e+00
254 | 0.000000000000000000e+00
255 | 0.000000000000000000e+00
256 | 0.000000000000000000e+00
257 | 0.000000000000000000e+00
258 | 0.000000000000000000e+00
259 | 0.000000000000000000e+00
260 | 0.000000000000000000e+00
261 | 0.000000000000000000e+00
262 | 0.000000000000000000e+00
263 | 0.000000000000000000e+00
264 | 0.000000000000000000e+00
265 | 0.000000000000000000e+00
266 | 0.000000000000000000e+00
267 | 0.000000000000000000e+00
268 | 0.000000000000000000e+00
269 | 0.000000000000000000e+00
270 | 0.000000000000000000e+00
271 | 0.000000000000000000e+00
272 | 0.000000000000000000e+00
273 | 0.000000000000000000e+00
274 | 0.000000000000000000e+00
275 | 0.000000000000000000e+00
276 | 0.000000000000000000e+00
277 | 0.000000000000000000e+00
278 | 0.000000000000000000e+00
279 | 0.000000000000000000e+00
280 | 0.000000000000000000e+00
281 | 0.000000000000000000e+00
282 | 0.000000000000000000e+00
283 | 0.000000000000000000e+00
284 | 0.000000000000000000e+00
285 | 0.000000000000000000e+00
286 | 0.000000000000000000e+00
287 | 0.000000000000000000e+00
288 | 0.000000000000000000e+00
289 | 0.000000000000000000e+00
290 | 0.000000000000000000e+00
291 | 0.000000000000000000e+00
292 | 0.000000000000000000e+00
293 | 0.000000000000000000e+00
294 | 0.000000000000000000e+00
295 | 0.000000000000000000e+00
296 | 0.000000000000000000e+00
297 | 0.000000000000000000e+00
298 | 0.000000000000000000e+00
299 | 0.000000000000000000e+00
300 | 0.000000000000000000e+00
301 | 0.000000000000000000e+00
302 | 0.000000000000000000e+00
303 | 0.000000000000000000e+00
304 | 0.000000000000000000e+00
305 | 0.000000000000000000e+00
306 | 0.000000000000000000e+00
307 | 0.000000000000000000e+00
308 | 0.000000000000000000e+00
309 | 0.000000000000000000e+00
310 | 0.000000000000000000e+00
311 | 0.000000000000000000e+00
312 | 0.000000000000000000e+00
313 | 0.000000000000000000e+00
314 | 0.000000000000000000e+00
315 | 0.000000000000000000e+00
316 | 0.000000000000000000e+00
317 | 0.000000000000000000e+00
318 | 0.000000000000000000e+00
319 | 0.000000000000000000e+00
320 | 0.000000000000000000e+00
321 | 0.000000000000000000e+00
322 | 0.000000000000000000e+00
323 | 0.000000000000000000e+00
324 | 0.000000000000000000e+00
325 | 0.000000000000000000e+00
326 | 0.000000000000000000e+00
327 | 0.000000000000000000e+00
328 | 0.000000000000000000e+00
329 | 0.000000000000000000e+00
330 | 0.000000000000000000e+00
331 | 0.000000000000000000e+00
332 | 0.000000000000000000e+00
333 | 0.000000000000000000e+00
334 | 0.000000000000000000e+00
335 | 0.000000000000000000e+00
336 | 0.000000000000000000e+00
337 | 0.000000000000000000e+00
338 | 0.000000000000000000e+00
339 | 0.000000000000000000e+00
340 | 0.000000000000000000e+00
341 | 0.000000000000000000e+00
342 | 0.000000000000000000e+00
343 | 0.000000000000000000e+00
344 | 0.000000000000000000e+00
345 | 0.000000000000000000e+00
346 | 0.000000000000000000e+00
347 | 0.000000000000000000e+00
348 | 0.000000000000000000e+00
349 | 0.000000000000000000e+00
350 | 0.000000000000000000e+00
351 | 0.000000000000000000e+00
352 | 0.000000000000000000e+00
353 | 0.000000000000000000e+00
354 | 0.000000000000000000e+00
355 | 0.000000000000000000e+00
356 | 0.000000000000000000e+00
357 | 0.000000000000000000e+00
358 | 0.000000000000000000e+00
359 | 0.000000000000000000e+00
360 | 0.000000000000000000e+00
361 | 0.000000000000000000e+00
362 | 0.000000000000000000e+00
363 | 0.000000000000000000e+00
364 | 0.000000000000000000e+00
365 | 0.000000000000000000e+00
366 | 0.000000000000000000e+00
367 | 0.000000000000000000e+00
368 | 0.000000000000000000e+00
369 | 0.000000000000000000e+00
370 | 0.000000000000000000e+00
371 | 0.000000000000000000e+00
372 | 0.000000000000000000e+00
373 | 0.000000000000000000e+00
374 | 0.000000000000000000e+00
375 | 0.000000000000000000e+00
376 | 0.000000000000000000e+00
377 | 0.000000000000000000e+00
378 | 0.000000000000000000e+00
379 | 0.000000000000000000e+00
380 | 0.000000000000000000e+00
381 | 0.000000000000000000e+00
382 | 0.000000000000000000e+00
383 | 0.000000000000000000e+00
384 | 0.000000000000000000e+00
385 | 0.000000000000000000e+00
386 | 0.000000000000000000e+00
387 | 0.000000000000000000e+00
388 | 0.000000000000000000e+00
389 | 0.000000000000000000e+00
390 | 0.000000000000000000e+00
391 | 0.000000000000000000e+00
392 | 0.000000000000000000e+00
393 | 0.000000000000000000e+00
394 | 0.000000000000000000e+00
395 | 0.000000000000000000e+00
396 | 0.000000000000000000e+00
397 | 0.000000000000000000e+00
398 | 0.000000000000000000e+00
399 | 0.000000000000000000e+00
400 | 0.000000000000000000e+00
401 | 0.000000000000000000e+00
402 | 0.000000000000000000e+00
403 | 0.000000000000000000e+00
404 | 0.000000000000000000e+00
405 | 0.000000000000000000e+00
406 | 0.000000000000000000e+00
407 | 0.000000000000000000e+00
408 | 0.000000000000000000e+00
409 | 0.000000000000000000e+00
410 | 0.000000000000000000e+00
411 | 0.000000000000000000e+00
412 | 0.000000000000000000e+00
413 |
--------------------------------------------------------------------------------
/DataSet/models/model_svm_rbf_0_0.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/models/model_svm_rbf_0_0.pickle
--------------------------------------------------------------------------------
/DataSet/models/model_svm_rbf_0_1.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/models/model_svm_rbf_0_1.pickle
--------------------------------------------------------------------------------
/DataSet/models/model_svm_rbf_0_10.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/models/model_svm_rbf_0_10.pickle
--------------------------------------------------------------------------------
/DataSet/models/model_svm_rbf_100_0.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/models/model_svm_rbf_100_0.pickle
--------------------------------------------------------------------------------
/DataSet/models/model_svm_rbf_100_1.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/models/model_svm_rbf_100_1.pickle
--------------------------------------------------------------------------------
/DataSet/models/model_svm_rbf_100_10.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/models/model_svm_rbf_100_10.pickle
--------------------------------------------------------------------------------
/DataSet/models/model_svm_rbf_10_0.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/models/model_svm_rbf_10_0.pickle
--------------------------------------------------------------------------------
/DataSet/models/model_svm_rbf_10_1.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/models/model_svm_rbf_10_1.pickle
--------------------------------------------------------------------------------
/DataSet/models/model_svm_rbf_10_10.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/models/model_svm_rbf_10_10.pickle
--------------------------------------------------------------------------------
/DataSet/models/model_svm_rbf_1_0.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/models/model_svm_rbf_1_0.pickle
--------------------------------------------------------------------------------
/DataSet/models/model_svm_rbf_1_1.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/models/model_svm_rbf_1_1.pickle
--------------------------------------------------------------------------------
/DataSet/models/model_svm_rbf_1_10.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sardhendu/License-Plate-Detection/e097f0323dc20a07ddf68d347a13a1b3e9a2889c/DataSet/models/model_svm_rbf_1_10.pickle
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Licence-Plate-Detection
2 | This project aims to utilize Machine Learning and Image Processing techniques to detect/extract license plates of vehicle given an image.
3 |
4 |
5 | ## Modules:
6 |
7 | * You would want to start with the module **LP_Detect_main.py**. Lets go one by one
8 |
9 | ### [Data Preparation and Feature Extraction](https://github.com/Sardhendu/License-Plate-Detection/blob/master/Code/Bld_FeatureCrps.py):
10 | * This module is aimed to extract features from a license plate/non license plate and store them in the disk (Training Features).
11 | * Here, we manually create a small dataset by cropping out License plates from vehicle images and small set of random images (non-license plates).
12 | * Usual image processing techniques such as thresholding, standarization, erosion etc. are applied to the images.
13 | * We employ **Histogram of Oriented Gradients (HOG)** as a features extraction technique. In a nutshell, given an image (say 32x32x3) **HOG** would create a feature vector which can be consumed by a Machine Learning model. You could even experiment with simple features extraction technique such as **Edges 32x32 = 1024x1**, **Flattening the image (32x32x3) into 3072x1** and use these vectors as an input to Machine learning Models.
14 |
15 | #### Module
16 | * Gets license plates and non-license plate from respective directories, extract features and stores the feature vectors into the disk
17 | * [Sample License Plate data](https://github.com/Sardhendu/License-Plate-Detection/tree/master/DataSet/Data-Files/images_train/Licence-Plate)
18 | * [Sample Non-License plate data](https://github.com/Sardhendu/License-Plate-Detection/tree/master/DataSet/Data-Files/images_train/Not-Licence-Plate)
19 |
20 | ### [Train Model](https://github.com/Sardhendu/License-Plate-Detection/blob/master/Code/BldModel.py):
21 | * From step 1 we already have our features, now all we have to do is send these features to a machine learning model to learn a reasonable boundary to separate License plates and Non-License plates.
22 | * In our case, the data is not very big, so we use **Support Vector Machines** as our machine learning model. SVM's with RBF kernel performs excellent with small data size and are robust to overfitting.
23 |
24 | ##### Module:
25 | * Fetches the saved features and the corresponding label (license_plate or non-license plate) and sends it to the SVM model.
26 | * Stores the learned model into the disk to be used while cross validation and testing.
27 | * [CSV files containing the features](https://github.com/Sardhendu/License-Plate-Detection/tree/master/DataSet/Feature-Model)
28 |
29 | ### [Cross Validation](https://github.com/Sardhendu/License-Plate-Detection/blob/master/Code/LP_Detect_main.py):
30 | * Now that we have a model in place we would want to validate the model to predict if a rectangular region is license plate or non-license plate
31 | * **Note** here we do not provide the whole image, but use manually extract license plates and random images to get a sense of the model performance
32 |
33 | ### [Extract License plate](https://github.com/Sardhendu/License-Plate-Detection/blob/master/Code/LP_Detect_main.py):
34 | * We have every thing set up. We have a good model too and have validated it against cross validation dataset. Now the aim is to extract all the license plate given a image containing vehicles.
35 | * We know that a license plate has visible edges. So, we extract all contours or region of interests **(ROI)** from a image, i.e (rectangles, circles polygon defined with intense edges).
36 | * We know that license plate are rectangular in shape, so we reshape/extend the **ROI** as rectangles. Note, for a given image we can have 100's or **ROI** of which only 2-3 would be license plate. So we have to classify all the **ROI** using our **SVM** model.
37 | * All the **ROI's** are send to the feature extractor module.
38 | * The generated features for each **ROI** are then send to the **SVM** classifier for classification.
39 | * A high probability (say >90%) indicates a **ROI** to be the license plate.
40 | * Finally we stash the **ROI** that have high probability of being a license plate into the disk for manual examination.
41 |
42 | **Look HERE** to get a sense of the directory name, so that you can run the model for yourself.
43 |
44 |
45 | ## Snapshot of the process
46 |
47 | #### Train:
48 | Training data is manually created by taking a vehicle's image and cropping out the license plate image. Another
49 | simple way would be to extract all possible contours form the image (look at /Code/Classify.py) and save them in a
50 | directory. Then manually go an select the license plates. Below are some images of License plates used for Training.
51 |
52 | ##### License Plates:
53 |
54 |
55 |
56 | ##### Non License Plates
57 |
58 |
59 |
60 |
61 | #### Test:
62 | For testing, an image containing a vehicle image with its license plate was provided. Given the image we first
63 | extracted all the **ROI's** and then classify each **ROI's** as a license plate or not a license plate.
64 |
65 |
66 | ##### Test Images:
67 |
69 |
70 | ##### Contours Extracted (Region of Interest)
71 |
72 |
73 | ##### Region of interest classified as License Plate
74 |
75 |
76 | A sample of Dataset is provided: Look under the directory folder "/DataSet" to get a sense of the dataset.
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/blog.py:
--------------------------------------------------------------------------------
1 | #-------------------------------------------------------------------------------
2 | # Name: module1
3 | # Purpose:
4 | #
5 | # Author: Sardhendu_Mishra
6 | #
7 | # Created: 15/03/2015
8 | # Copyright: (c) Sardhendu_Mishra 2015
9 | # Licence:
10 | #-------------------------------------------------------------------------------
11 |
12 | """
13 | import cv2
14 | import sys
15 | sys.path.insert(0, 'C:\\Users\\sardhendu_mishra\\Desktop\\StudyHard\\Machine_learning\\Data mining and analysis\\image_processing')
16 | import imutils
17 |
18 | image=cv2.imread("C:\\Users\\sardhendu_mishra\\Desktop\\ahha\\DSC_0023.jpg")
19 |
20 | image_resize=imutils.resize(image,width=700)
21 |
22 | image_gray = cv2.cvtColor(image_resize, cv2.COLOR_BGR2GRAY)
23 |
24 | image_blurr=cv2.GaussianBlur(image_gray, (3,3), 0)
25 |
26 | image_thresh=cv2.adaptiveThreshold(image_blurr,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C,cv2.THRESH_BINARY,11,2)
27 |
28 | cv2.imwrite("C:\\Users\\sardhendu_mishra\\Desktop\\ahha\\23.jpg", image_thresh)
29 | cv2.imshow("image_orig",image_thresh)
30 | cv2.waitKey()
31 |
32 |
33 | """
34 | import numpy as np
35 |
36 |
37 | f=np.fromfile("C:\\Users\\sardhendu_mishra\\Desktop\\StudyHard\\Machine_learning\\Data_sets\\For_blog\\ex4x.dat", dtype='float64')
38 | fa=np.fromfile("C:\\Users\\sardhendu_mishra\\Desktop\\StudyHard\\Machine_learning\\Data_sets\\For_blog\\ex4y.dat", dtype='float64')
39 |
40 | a=f.read()
41 |
42 | """
43 | x=np.array(feature_array,dtype="float64")
44 | y=np.array(class_array,dtype="float64")
45 |
46 | # Add the intercept value 1 to the first column. the 0 indicates first column and 1 indicates the intercept term
47 | x=np.insert(x,0,1,axis=1)
48 | (m,n)=x.shape
49 | # Calculate mean and standard deviation
50 | mn=np.mean(x, axis=0) # axis=0 will perform column wise mean
51 | sd=np.std(x, axis=0)
52 |
53 | """
--------------------------------------------------------------------------------
/config-local.conf:
--------------------------------------------------------------------------------
1 | [Dataset]
2 | Train_data1 = App-DataSet/Plate-Detection/Data-Files/images_train/Licence-Plate/*.jpg
3 | Train_data2 = App-DataSet/Plate-Detection/Data-Files/images_train/Not-Licence-Plate/*.jpg
4 | Valid_data1 = App-DataSet/Plate-Detection/Data-Files/images_crossvalidate/Licence-Plate/*.jpg
5 | Valid_data2 = App-DataSet/Plate-Detection/Data-Files/images_crossvalidate/Not-Licence-Plate/*.jpg
6 |
7 |
8 | [Feature-Labels]
9 | Data_feature = App-DataSet/Plate-Detection/Feature-Model/feature_train.csv
10 | Class_labels = App-DataSet/Plate-Detection/Feature-Model/class_train.csv
11 | Data_feature_KernelCnvtd = App-DataSet/Plate-Detection/Feature-Model/feature_train_kernel_cnvrtd.csv
12 | Theta_val = App-DataSet/Plate-Detection/Feature-Model/theta_val.csv
13 | Data_feature_KernelCnvtd_tst = App-DataSet/Plate-Detection/Feature-Model/feature_test_kernel_cnvrtd.csv
14 |
15 |
16 | [Models]
17 | Linear_SVC = App-DataSet/Plate-Detection/models/model_linear_svc.pickle
18 | SVM_RFB = App-DataSet/Plate-Detection/models/
19 | models = App-DataSet/Plate-Detection/models/*.pickle
20 |
21 | [Images_to_classify]
22 | Indian_cars = App-DataSet/Plate-Detection/Data-Files/images_classify/Indian_cars/*.jpg
23 | Foreign_cars = App-DataSet/Plate-Detection/Data-Files/images_classify/Foreign_cars/*.jpg
24 |
25 | [Contored_images]
26 | Regions_of_Intrest = App-DataSet/Plate-Detection/Data-Files/images_classify/contoured_images_roi/
27 |
28 | [Classified_License_plates]
29 | classified_license_plate = App-DataSet/Plate-Detection/Data-Files/images_classify/extracted_licenceplate_image/
30 |
--------------------------------------------------------------------------------
/gradient_calculation.py:
--------------------------------------------------------------------------------
1 | #-------------------------------------------------------------------------------
2 | # Name: module1
3 | # Purpose:
4 | #
5 | # Author: Sardhendu_Mishra
6 | #
7 | # Created: 10/03/2015
8 | # Copyright: (c) Sardhendu_Mishra 2015
9 | # Licence:
10 | #-------------------------------------------------------------------------------
11 |
12 |
13 | '''
14 | About: This code snippet is written to calculate the gradient of each pixel, every pixel of an image call this code snippet and the code snippet \
15 | returns the magnitude of the very pixel.
16 | '''
17 |
18 | import math
19 | import cv2
20 |
21 |
22 |
23 | # Not needed in our case because we take care of the pixel coordinate in generate_pixel function ,, anyway this checks if the pixel in process is in range of the pixel size
24 | def check_pixel_range (image, r, c): #c is the column and r is the row
25 | total_size_xaxis=image.shape[1]
26 | total_size_yaxis=image.shape[0]
27 | return c>0 and c0 and r
10 | #-------------------------------------------------------------------------------
11 |
12 | import cv2
13 | import mahotas
14 | import numpy as np
15 | import sys
16 | sys.path.insert(0, 'C:\\Users\\sardhendu_mishra\\Desktop\\StudyHard\\Machine_learning\\Data mining and analysis\\image_processing')
17 | import imutils
18 | import HOG_computation
19 |
20 |
21 | def create_histogram_for_image(image):
22 | hog= HOG_computation.HOG(orientations=18, pixelsPerCell=(10,10), cellsPerBlock=(3,3), normalize=True)
23 |
24 | # Convert the coloured image into grayscale image
25 | image_resized=imutils.resize(image, width=300)
26 | image_gray=cv2.cvtColor(image_resized, cv2.COLOR_BGR2GRAY)
27 |
28 | # Do thresholding
29 | image_thresh=image_gray
30 | T=mahotas.thresholding.otsu(image_gray) # will find an optimal value of T from the image
31 | image_thresh[image_thresh>T]=255 # This goes pixel by pixel if the pixel value of the thresh is greater than the optimal value then the color is white
32 | image_thresh[image_thresh