1
我用下面的代碼來檢測圈:圓檢測是跳躍
gray = cv2.GaussianBlur(gray, (5, 5), 0);
gray = cv2.medianBlur(gray, 5)
kernel = np.ones((2, 2), np.uint8)
gray = cv2.erode(gray, kernel, iterations=1)
gray = cv2.dilate(gray, kernel, iterations=1)
circles = cv2.HoughCircles(gray, cv2.HOUGH_GRADIENT, 1, 200,
param1=100, param2=50, minRadius=0, maxRadius=150)
if circles is not None:
# Convert the (x,y) coordinate and radius of the circles
circles = np.round(circles[0, :]).astype("int")
# Loop over the (x,y) coordinate and radius of the circles
for (x, y, r) in circles:
# Draw the circle in the output
cv2.circle(fancy_frame, (x+x1, y+y1), r, (0, 255, 0), 4)
然而,當我發現的圓跳動。我怎樣才能解決這個問題?有沒有haar或svm來檢測它?
這是我得到的輸出:
我想檢測實時視頻
發佈您的結果和預期結果。 – zindarod
請檢查更新的問題 – user1241241
您必須應用一些跟蹤算法,例如kalman-filter – eyllanesc