File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 2
2
from glob import glob
3
3
import cv2
4
4
5
-
6
5
def barcode (decoded , image ):
7
6
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 )
12
10
return imge
13
11
14
-
15
12
def scan (image ):
16
13
dcode = decode (image )
17
14
for obj in dcode :
@@ -23,9 +20,9 @@ def scan(image):
23
20
return image
24
21
25
22
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 :
29
26
img = cv2 .imread (code )
30
27
img = scan (img )
31
28
cv2 .imshow ("img" , img )
You can’t perform that action at this time.
0 commit comments