Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def add_dark_noise(image):
|
|
34 |
|
35 |
def apply_cartoon_filter(image):
|
36 |
# Convert to OpenCV format
|
37 |
-
img_rgb = np.array(image)
|
38 |
img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_RGB2GRAY)
|
39 |
img_gray = cv2.medianBlur(img_gray, 5)
|
40 |
edges = cv2.adaptiveThreshold(img_gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 9, 9)
|
|
|
34 |
|
35 |
def apply_cartoon_filter(image):
|
36 |
# Convert to OpenCV format
|
37 |
+
img_rgb = np.array(image).astype(np.uint8)
|
38 |
img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_RGB2GRAY)
|
39 |
img_gray = cv2.medianBlur(img_gray, 5)
|
40 |
edges = cv2.adaptiveThreshold(img_gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 9, 9)
|