Spaces:
Runtime error
Runtime error
Commit
·
69099d3
1
Parent(s):
e699b7a
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,13 +42,13 @@ def sign(img):
|
|
| 42 |
cv2.rectangle(imgOutput, (0,30),(80,80), (255, 0, 255), cv2.FILLED)
|
| 43 |
cv2.putText(imgOutput, 'K', (20, 75), cv2.FONT_HERSHEY_COMPLEX, 1.7, (255, 255, 255), 2)
|
| 44 |
return imgOutput
|
| 45 |
-
if imlist[4][0]>imlist[8][0] and imlist[4][0]>imlist[12][0] and imlist[4][0]>imlist[16][0] and imlist[4][0]>imlist[20][0]:
|
| 46 |
print('In M')
|
| 47 |
cv2.rectangle(imgOutput, (x-offset, y-offset),(x + w+offset, y + h+offset), (255, 0, 255), 4)
|
| 48 |
imgOutput = cv2.flip(imgOutput,1)
|
| 49 |
cv2.rectangle(imgOutput, (0,30),(80,80), (255, 0, 255), cv2.FILLED)
|
| 50 |
cv2.putText(imgOutput, 'M', (20, 75), cv2.FONT_HERSHEY_COMPLEX, 1.7, (255, 255, 255), 2)
|
| 51 |
-
return imgOutput
|
| 52 |
|
| 53 |
imgWhite = np.ones((imgSize, imgSize, 3), np.uint8) * 255
|
| 54 |
imgCrop = img[y - offset:y + h + offset, x - offset:x + w + offset]
|
|
|
|
| 42 |
cv2.rectangle(imgOutput, (0,30),(80,80), (255, 0, 255), cv2.FILLED)
|
| 43 |
cv2.putText(imgOutput, 'K', (20, 75), cv2.FONT_HERSHEY_COMPLEX, 1.7, (255, 255, 255), 2)
|
| 44 |
return imgOutput
|
| 45 |
+
'''if imlist[4][0]>imlist[8][0] and imlist[4][0]>imlist[12][0] and imlist[4][0]>imlist[16][0] and imlist[4][0]>imlist[20][0]:
|
| 46 |
print('In M')
|
| 47 |
cv2.rectangle(imgOutput, (x-offset, y-offset),(x + w+offset, y + h+offset), (255, 0, 255), 4)
|
| 48 |
imgOutput = cv2.flip(imgOutput,1)
|
| 49 |
cv2.rectangle(imgOutput, (0,30),(80,80), (255, 0, 255), cv2.FILLED)
|
| 50 |
cv2.putText(imgOutput, 'M', (20, 75), cv2.FONT_HERSHEY_COMPLEX, 1.7, (255, 255, 255), 2)
|
| 51 |
+
return imgOutput'''
|
| 52 |
|
| 53 |
imgWhite = np.ones((imgSize, imgSize, 3), np.uint8) * 255
|
| 54 |
imgCrop = img[y - offset:y + h + offset, x - offset:x + w + offset]
|