Skip to content

Commit 046e3c0

Browse files
authored
Update barcode_scanner.py
1 parent 0db0e9c commit 046e3c0

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

barcode_scanner/barcode_scanner.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22
from glob import glob
33
import cv2
44

5-
65
def barcode(decoded, image):
76
imge = cv2.rectangle(image, (decoded.rect.left,
8-
decoded.rect.top), (decoded.rect.left + decoded.rect.width,
9-
decoded.rect.top +
10-
decoded.rect.height),
11-
color=(0, 255, 0), thickness=5)
7+
decoded.rect.top), (decoded.rect.left + decoded.rect.width,
8+
decoded.rect.top + decoded.rect.height),
9+
color=(0, 255, 0), thickness=5)
1210
return imge
1311

14-
1512
def scan(image):
1613
dcode = decode(image)
1714
for obj in dcode:
@@ -23,9 +20,9 @@ def scan(image):
2320
return image
2421

2522

26-
dat = input("Enter the path of the barcode")
27-
data = glob(dat)
28-
for code in data:
23+
data = input("Enter the path of the barcode")
24+
dat = glob(data)
25+
for code in dat:
2926
img = cv2.imread(code)
3027
img = scan(img)
3128
cv2.imshow("img", img)

0 commit comments

Comments
 (0)