![]() |
VOOZH | about |
Edge detection identifies object boundaries by detecting sharp intensity changes in an image. When applied directly to real-time frames, it often produces noisy and overly sharp edges. To improve results, blurring is applied as a preprocessing step before edge detection. Blurring before edge detection helps in:
Hence, blurring is an important step in most real-world edge detection applications.
1. cv2.flip(): This function flips an image or video frame, which is used to create a mirrored view. Below is the syntax:
cv2.flip(src, flipCode)
Parameters:
2. cv2.blur(): This function applies an averaging blur to an image. Below is the syntax:
cv2.blur(src, ksize)
Parameters:
3. cv2.Canny(): This function detects edges in an image using Canny edge detection algorithm. It identifies areas with strong intensity changes that represent object boundaries. Below is the syntax:
cv2.Canny(image, threshold1, threshold2)
Parameters:
The following program captures live video from a webcam, applies blur and edge detection and displays different stages of processing in real time for comparison.
Output: After running the program, four live windows are displayed:
The blurred edge detection output clearly shows reduced noise and smoother edges.