Edge detection is one of the most popular techniques in Computer Vision. It is used as a preprocessing step in many applications. Let's look at how to use different edge detectors to detect edges in the input image.
import sys import cv2 import numpy as np
# Load the input image -- 'chair.jpg' # Convert it to grayscale input_file = sys.argv img = cv2.imread(input_file, cv2.IMREAD_GRAYSCALE)
h, w = img.shape