Rev 287 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
//#include "opencv2/highgui/highgui.hpp"//#include "opencv2/video/tracking.hpp"//#include <Windows.h>//#include "KalmanFilter.h"////#define drawCross( center, color, d ) \// line(img, cv::Point(center.x - d, center.y - d), cv::Point(center.x + d, center.y + d), color, 2, CV_AA, 0); \// line(img, cv::Point(center.x + d, center.y - d), cv::Point(center.x - d, center.y + d), color, 2, CV_AA, 0)////using namespace std;////int main() {//// char code = (char)-1;// POINT mousePos;// GetCursorPos(&mousePos);//// KalmanFilter KF(mousePos.x, mousePos.y);//// // Image to show mouse tracking// cv::Mat img(600, 800, CV_8UC3);// vector<cv::Point> mousev, kalmanv;// mousev.clear();// kalmanv.clear();//// while (1) {// KF.predict();//// // Get mouse point// GetCursorPos(&mousePos);//// cv::Point measPt = cv::Point(mousePos.x, mousePos.y);// cv::Point statePt = KF.correct(mousePos.x, mousePos.y);//// // plot points// imshow("mouse kalman", img);// img = cv::Scalar::all(0);//// mousev.push_back(measPt);// kalmanv.push_back(statePt);// drawCross(statePt, cv::Scalar(255, 255, 255), 5);// drawCross(measPt, cv::Scalar(0, 0, 255), 5);//// for (int i = 0; i < mousev.size() - 1; i++)// line(img, mousev[i], mousev[i + 1], cv::Scalar(255, 255, 0), 1);//// for (int i = 0; i < kalmanv.size() - 1; i++)// line(img, kalmanv[i], kalmanv[i + 1], cv::Scalar(0, 155, 255), 1);//// code = (char)cv::waitKey(100);// if (code > 0)// break;// }//// return 0;//}