Block 116: Edge Detection & Thresholding
Detect edges and separate foreground from background.
Concepts
- cv2.Canny() edge detection with thresholds
- cv2.threshold() — binary, Otsu's method
- cv2.adaptiveThreshold() for varying lighting
- Morphological operations: dilate, erode
Code Examples
See exercise below.
Exercise
Apply Canny edge detection with low/mid/high thresholds. Compare results. Apply Otsu's thresholding to separate object from background.
Homework
What do the two threshold parameters in cv2.Canny() control? How would you tune them? Thursday