Skip to content

Latest commit

Β 

History

History
50 lines (32 loc) Β· 1.34 KB

File metadata and controls

50 lines (32 loc) Β· 1.34 KB

Edge Detection & Thresholding


Image Processing Flowchart

  1. Canny Edge Detection
  2. Image Thresholding ( Binary , Adaptive )
  3. Bitwise Operations ( AND , OR , NOT )

Canny Edge Detection

edges = cv2.Canny(image , threshold1 , threshold2 )

It actually gives us the outline of objects from an image. Like if there is a circle we will get an outline of circle , if someone's face is there we get a outline of it also.

Detects border , separates objects , feature extraction.

Threshold 1 -> lower boundary ~ weak edges Threshold 2 -> upper boundary ~ strong edges It is basically stating if any pixel is bright take it to b rightest value , same with dark -> darkest.


Thresholding

threshold_img = cv2.threshold(img , thresh_value , max_values , method)

thresh_value -> 0 - 255 max_value -> 255 method -> generally used is binary(if value more the threshold then it set its under 255 else set to 0)


Bitwise Operations

cv2.bitwise_and(img1 , img2)
cv2.bitwise_or(img1 , img2)
cv2.bitwise_not(img1)

Basically used if we want to merger 2 images , cut 1 image using 2nd image , flip or remove pixels. AND -> to cut overlap OR -> to merge NOT -> to invert