Mój starty projekt analizy wideo przy pomocy OpenCV.
Na filmie widać 2 algorytmy
- Candy algorithm
- Sobel algorithm
Poniżej film jak to wyglądało w ruchu i screen.
Cały projekt znajduje się poniżej i na GitHub.
https://github.com/DarkGL3/Video-Analysis
Przykładowy kod
cv::Mat edges; cv::GaussianBlur( frame, edges, cv::Size(3,3), 0, 0, cv::BORDER_DEFAULT ); cv::cvtColor( edges, edges, CV_RGB2GRAY ); cv::Mat grad_x, grad_y; cv::Mat abs_grad_x, abs_grad_y; cv::Sobel( edges, grad_x, CV_16S, 1, 0, 3, 1, 0, cv::BORDER_DEFAULT ); cv::Sobel( edges, grad_y, CV_16S, 0, 1, 3, 1, 0, cv::BORDER_DEFAULT ); cv::convertScaleAbs( grad_x, abs_grad_x ); cv::convertScaleAbs( grad_y, abs_grad_y ); cv::addWeighted( abs_grad_x, 0.5, abs_grad_y, 0.5, 0, edges ); cv::imshow( windowName, edges );