Skip to content

Instantly share code, notes, and snippets.

@monogenea
Last active May 3, 2026 12:55
Show Gist options
  • Select an option

  • Save monogenea/51737211c8e9b6189c0d3eb2997af26e to your computer and use it in GitHub Desktop.

Select an option

Save monogenea/51737211c8e9b6189c0d3eb2997af26e to your computer and use it in GitHub Desktop.
# Convert to RGB so we can draw edges in red
overlay = cv2.cvtColor(image, cv2.COLOR_GRAY2RGB)
overlay[edges > 0] = [220, 40, 40] # red edges
fig, ax = plt.subplots(figsize=(6, 6))
ax.imshow(overlay)
ax.set_title('Canny edges overlaid (σ=1.4, T=50/150)')
ax.axis('off')
plt.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment