AK47-M4A4's picture
v1
ae1d0b9
raw
history blame contribute delete
357 Bytes
import cv2
import numpy as np
from PIL import Image
# Load the colorful image
image_path = "test.png"
image = cv2.imread(image_path)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
gray = cv2.convertScaleAbs(gray, alpha=1.2, beta=20)
gray = cv2.GaussianBlur(gray, (5, 5), 0)
edges = cv2.Canny(gray, 50, 150, apertureSize=3)
cv2.imwrite("new.png", edges)