Commit 05f45a3b authored by Gary Bradski's avatar Gary Bradski

revamped

parent 8dd85835
......@@ -2,8 +2,20 @@
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
void help()
{
cout <<
"\nThis program demonstrates dense, Farnback, optical flow\n"
"Mainly the function: calcOpticalFlowFarneback()\n"
"Call:\n"
"./fback\n"
"This reads from video camera 0\n" << endl;
}
void drawOptFlowMap(const Mat& flow, Mat& cflowmap, int step,
double, const Scalar& color)
{
......@@ -20,7 +32,7 @@ void drawOptFlowMap(const Mat& flow, Mat& cflowmap, int step,
int main(int, char**)
{
VideoCapture cap(0);
help();
if( !cap.isOpened() )
return -1;
......@@ -34,7 +46,7 @@ int main(int, char**)
if( prevgray.data )
{
calcOpticalFlowFarneback(prevgray, gray, flow, 0.5, 3, 15, 3, 5, 1.2, 0);
(prevgray, gray, flow, 0.5, 3, 15, 3, 5, 1.2, 0);
cvtColor(prevgray, cflow, CV_GRAY2BGR);
drawOptFlowMap(flow, cflow, 16, 1.5, CV_RGB(0, 255, 0));
imshow("flow", cflow);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment