HimanshuA commited on
Commit
0680065
·
verified ·
1 Parent(s): ce5b353

Update classifier.py

Browse files
Files changed (1) hide show
  1. classifier.py +6 -2
classifier.py CHANGED
@@ -24,8 +24,12 @@ def my_function(uploaded_file):
24
 
25
 
26
  def detect_plate(img, text=''): # the function detects and perfors blurring on the number plate.
27
- plate_img = img.copy()
28
- roi = img.copy()
 
 
 
 
29
  plate_rect = plate_cascade.detectMultiScale(plate_img, scaleFactor = 1.2, minNeighbors = 7) # detects numberplates and returns the coordinates and dimensions of detected license plate's contours.
30
  for (x,y,w,h) in plate_rect:
31
  roi_ = roi[y:y+h, x:x+w, :] # extracting the Region of Interest of license plate for blurring.
 
24
 
25
 
26
  def detect_plate(img, text=''): # the function detects and perfors blurring on the number plate.
27
+ #plate_img = img.copy()
28
+ #roi = img.copy()
29
+ plate_img = Image.open(img)
30
+ roi = Image.open(img)
31
+
32
+
33
  plate_rect = plate_cascade.detectMultiScale(plate_img, scaleFactor = 1.2, minNeighbors = 7) # detects numberplates and returns the coordinates and dimensions of detected license plate's contours.
34
  for (x,y,w,h) in plate_rect:
35
  roi_ = roi[y:y+h, x:x+w, :] # extracting the Region of Interest of license plate for blurring.