I'm doing Canny edge detection on a video stream from my webcam and i've been trying to find parameters to reduce the flicker. I'm wonderng if thicker lines representing the edges might not do the trick.
The code I have working at the moment is
# inspired by hhttps://shahsparx.me/edge-detection-opencv-python-video-image/ttps://shahsparx.me/edge-detection-opencv-python-video-image/
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
while(1):
ret, frame = cap.read()
gray_vid = cv2.cvtColor(frame, cv2.IMREAD_GRAYSCALE)
cv2.imshow('Original',frame)
edged_frame = cv2.Canny(frame,100,200)
cv2.imshow('Edges',edged_frame)
# Quit with 'Esc' key
k= cv2.waitKey(5) & 0xFF
if k==27:
break
cap.release()
cv2.destroyAllWindows()
but it's very flickery, i.e. many of the detected edges appear and disappear, particular where the edges are faint like at wrinkles, hair, background elements etc. Are there opencv parameters to be used either at the videocapture or the transformations that can help out ?
