mertbozkurt commited on
Commit
065397d
·
1 Parent(s): 2f6ebcb

Update optic1.py

Browse files
Files changed (1) hide show
  1. optic1.py +4 -4
optic1.py CHANGED
@@ -62,8 +62,8 @@ def optic1(ans_txt,pathImage, save_images= True):
62
  imgWarpColored_1 = cv2.warpPerspective(img, matrix, (wrap_v, wrap_h))
63
  imgWarpGray_1 = cv2.cvtColor(imgWarpColored_1,cv2.COLOR_BGR2GRAY)
64
  # imgThresh_1 = cv2.threshold(imgWarpGray_1, 170, 255,cv2.THRESH_BINARY_INV )[1]
65
- imgWarpColored_1 = cv2.convertScaleAbs(imgWarpColored_1)
66
- imgThresh_1 = cv2.threshold(imgWarpColored_1,0,255,cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
67
 
68
  #second buyuk icin perspektif
69
  secondContour=functions.reorder(secondContour)
@@ -73,8 +73,8 @@ def optic1(ans_txt,pathImage, save_images= True):
73
  imgWarpColored_2 = cv2.warpPerspective(img, matrix_2, (wrap_v, wrap_h))
74
  imgWarpGray_2 = cv2.cvtColor(imgWarpColored_2,cv2.COLOR_BGR2GRAY)
75
  #imgThresh_2 = cv2.threshold(imgWarpGray_2, 170, 255,cv2.THRESH_BINARY_INV )[1]
76
- imgWarpColored_2 = cv2.convertScaleAbs(imgWarpColored_2)
77
- imgThresh_2 = cv2.threshold(imgWarpColored_2,0,255,cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
78
 
79
  #student id
80
  bubbles = functions.split_num(imgThresh_2, 10, 10)
 
62
  imgWarpColored_1 = cv2.warpPerspective(img, matrix, (wrap_v, wrap_h))
63
  imgWarpGray_1 = cv2.cvtColor(imgWarpColored_1,cv2.COLOR_BGR2GRAY)
64
  # imgThresh_1 = cv2.threshold(imgWarpGray_1, 170, 255,cv2.THRESH_BINARY_INV )[1]
65
+ #imgWarpColored_1 = cv2.convertScaleAbs(imgWarpGray_2)
66
+ imgThresh_1 = cv2.threshold(imgWarpGray_1,0,255,cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
67
 
68
  #second buyuk icin perspektif
69
  secondContour=functions.reorder(secondContour)
 
73
  imgWarpColored_2 = cv2.warpPerspective(img, matrix_2, (wrap_v, wrap_h))
74
  imgWarpGray_2 = cv2.cvtColor(imgWarpColored_2,cv2.COLOR_BGR2GRAY)
75
  #imgThresh_2 = cv2.threshold(imgWarpGray_2, 170, 255,cv2.THRESH_BINARY_INV )[1]
76
+ # imgWarpGray_2 = cv2.convertScaleAbs(imgWarpGray_2)
77
+ imgThresh_2 = cv2.threshold(imgWarpGray_2,0,255,cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
78
 
79
  #student id
80
  bubbles = functions.split_num(imgThresh_2, 10, 10)