Skip to content

Instantly share code, notes, and snippets.

@victormurcia
Created October 20, 2022 15:35
Show Gist options
  • Select an option

  • Save victormurcia/0242cf2f81701de77ff61c1deccc40c5 to your computer and use it in GitHub Desktop.

Select an option

Save victormurcia/0242cf2f81701de77ff61c1deccc40c5 to your computer and use it in GitHub Desktop.
detecting edges with canny
#cv2.Canny(image, minVal, maxVal)
img_gray = cv2.cvtColor(rgb_img, cv2.COLOR_RGB2GRAY)
thresholds = [(5,150), (100,150), (200,225)]
fig,axs = plt.subplots(1,4, figsize=(30,15))
i = 0
axs[i].imshow(rgb_img)
for (minVal, maxVal) in thresholds:
edge_img = cv2.Canny(img_gray, minVal, maxVal, apertureSize = 3, L2gradient = False)
axs[i+1].imshow(edge_img)
i += 1
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment