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