Edge Detection Using Canny Edge Detector: AIM Source Code
Edge Detection Using Canny Edge Detector: AIM Source Code
Muni Mahesh
Roll Number : 21121A0534
SOURCE CODE:
import cv2
import numpy as np
import matplotlib.pyplot as plt
# Convert to grayscale
gray_image = cv2.cvtColor(original_image, cv2.COLOR_BGR2GRAY)
plt.subplot(1, 3, 1)
plt.title("Original Image")
plt.imshow(original_image_rgb)
plt.axis('off')
plt.subplot(1, 3, 2)
plt.title("Segmented Binary Image")
plt.imshow(binary_image, cmap='gray')
plt.axis('off')
plt.subplot(1, 3, 3)
plt.title("Edges Detected with Canny")
plt.imshow(edges, cmap='gray')
plt.axis('off')
plt.show()
OUTPUT:
RESULT: The above program for edge detection in a segmented binary image using Canny
edge detector has been implemented successfully.