Replies: 1 comment 1 reply
-
|
Hey, Although the link that I am pasting is realted to different error but this will surely help you. Try it out and if then also your problem isn't resolved then I am here for you to help. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
help me please
import cv2
import numpy as np
####################
widthImg = 640
heightImg = 480
#######################
cap = cv2.VideoCapture(1)
cap.set(3, widthImg)
cap.set(4, heightImg)
cap.set(10, 150)
def preProcessing(img):
imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
imgBlur = cv2.GaussianBlur(imgGray, (5, 5), 1)
imgCanny = cv2.Canny(imgBlur, 200, 200)
kernel = np.ones((5, 5))
imgDialte = cv2.dilate(imgCanny, kernel, iterations=2) # deux fois dialation
imgThres = cv2.erode(imgDialte, kernel, iterations=1)
return imgThres
while True:
success, img = cap.read()
img = cv2.resize(img, (widthImg, heightImg))
imgThres = preProcessing(img)
cv2.imshow("Result", imgThres)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
Beta Was this translation helpful? Give feedback.
All reactions