I'am trying to detect moving circles using OpenCV/C++. My code:
m_capture >> imageRGB;
cv::cvtColor(imageRGB, imgageGray, cv::COLOR_RGB2GRAY);
cv::Scalar mu;
cv::Scalar sigma;
cv::meanStdDev(imgageGray, mu, sigma);
cv::Mat imageCanny;
cv::Canny(imgageGray,
imageCanny,
mu.val[0] + sigma.val[0],
mu.val[0] - sigma.val[0]);
std::vector<std::vector<cv::Point> > contours;
std::vector<cv::Vec4i> hierarchy;
cv::findContours(imageCanny, contours, hierarchy,CV_RETR_TREE, CV_CHAIN_APPROX_NONE);
After this I'am checking is there any circle and is it right circle. If circle is not moving or moving slowly it's okay. https://i.stack.imgur.com/TM4sf.jpg
But if circle moving faster it's became undetectable. https://i.stack.imgur.com/1axJn.jpg
So, can somebody give me advice how to detect moving circle in a better way? UPD: My camera is Logitech c920.