Spaces:
Runtime error
Runtime error
Commit ·
b64e8b0
1
Parent(s): a9e3eeb
Update app.py
Browse files142 unmodified lines143144145146147148149150151152153154142 unmodified lines# Apply OTSU's thresholding_, thresh = cv2.threshold(gray_image, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)# Apply median blurthresh = cv2.medianBlur(thresh, 3)# # Apply morphological closing# kernel = np.ones((3,3), np.uint8)# thresh = cv2.morphologyEx(thresh, cv2.MORPH_CLOSE, kernel)# Convert thresholded image back to PIL format to display in Streamlitthresh_pil = Image.fromarray(thresh)142 unmodified lines143144145146147148149150151152153154155156157142 unmodified lines# Apply OTSU's thresholding_, thresh = cv2.threshold(gray_image, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)# # Apply median blur# thresh = cv2.medianBlur(thresh, 3)# Apply morphological thinning# thresh = cv2.ximgproc.thinning(thresh)# Apply morphological closingkernel = np.ones((3,3), np.uint8)thresh = cv2.morphologyEx(thresh, cv2.MORPH_CLOSE, kernel)# Convert thresholded image back to PIL format to display in Streamlitthresh_pil = Image.fromarray(thresh)
app.py+8-5