Spaces:
Sleeping
Sleeping
HuggingFace-SK
commited on
Commit
·
1be30b3
1
Parent(s):
d10e94c
add global threashold
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ def analyse():
|
|
| 26 |
equalized = clahe.apply(blur)
|
| 27 |
|
| 28 |
# Optional: Apply thresholding or other preprocessing techniques
|
| 29 |
-
|
| 30 |
|
| 31 |
# Use pytesseract to extract text
|
| 32 |
results = reader.readtext(equalized)
|
|
@@ -35,6 +35,7 @@ def analyse():
|
|
| 35 |
results_array.append(f"Detected text: {text} (Confidence: {prob})")
|
| 36 |
|
| 37 |
# Iterate through the results and format them
|
|
|
|
| 38 |
#cv2.imshow("clahe", equalized)
|
| 39 |
#cv2.imshow("blur", blur)
|
| 40 |
#cv2.imshow("orig", gray_image)
|
|
|
|
| 26 |
equalized = clahe.apply(blur)
|
| 27 |
|
| 28 |
# Optional: Apply thresholding or other preprocessing techniques
|
| 29 |
+
_, thresh_image = cv2.threshold(equalized, 150, 255, cv2.THRESH_BINARY)
|
| 30 |
|
| 31 |
# Use pytesseract to extract text
|
| 32 |
results = reader.readtext(equalized)
|
|
|
|
| 35 |
results_array.append(f"Detected text: {text} (Confidence: {prob})")
|
| 36 |
|
| 37 |
# Iterate through the results and format them
|
| 38 |
+
#cv2.imshow("threash", thresh_image)
|
| 39 |
#cv2.imshow("clahe", equalized)
|
| 40 |
#cv2.imshow("blur", blur)
|
| 41 |
#cv2.imshow("orig", gray_image)
|