eho69 commited on
Commit
ae528b8
·
verified ·
1 Parent(s): 3a094c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -93,12 +93,15 @@ def scan_edges(image):
93
  # Convert to grayscale
94
  gray = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
95
 
 
 
96
  # Apply Gaussian blur
97
  blurred = cv2.GaussianBlur(gray, (5, 5), 0)
98
-
 
99
 
100
  # Edge detection using Canny
101
- edges = cv2.Canny(blurred, 50, 150)
102
 
103
  # Convert back to RGB for display
104
  edges_rgb = cv2.cvtColor(edges, cv2.COLOR_GRAY2RGB)
 
93
  # Convert to grayscale
94
  gray = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
95
 
96
+ clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8))
97
+
98
  # Apply Gaussian blur
99
  blurred = cv2.GaussianBlur(gray, (5, 5), 0)
100
+
101
+ enhanced = clahe.apply(gray_image)
102
 
103
  # Edge detection using Canny
104
+ edges = cv2.Canny(enhanced, 50, 150)
105
 
106
  # Convert back to RGB for display
107
  edges_rgb = cv2.cvtColor(edges, cv2.COLOR_GRAY2RGB)