image_output_1.png
import cv2

import matplotlib.pyplot as plt

path = '/kaggle/input/sports-image-dataset/data/badminton/00000052.jpg'
img = cv2.imread(path)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
plt.axis('off')

gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
plt.axis('off')

canny = cv2.Canny(gray, 100, 200)
plt.imshow(canny)
plt.axis('off')
plt.show()