/Object-Tracking

This object tracking library is optimized by eigen3 and openMP

Primary LanguageMakefileGNU General Public License v3.0GPL-3.0

image


Object-Tracking

 author Haibo     contributions welcome

This object tracking library is optimized by using Eigen3 and openMP

  • Author: Haibo Wang
  • Email: dasuda2015@163.com
  • This is an open source Object-Tracking library, The development language is C++, The classic and mainstream object tracking algorithms and related algorithms are reproduced(For example, RANSAC, least squares and so on). Of course, these are optimized by Eigen3 and openMP.

Hardware platform:

  • CPU: intel i5 7500
  • Memory: 8G x 2 DDR4
  • GPU: GTX 1070 8GHz

Performance:

  • RANSAC:
    Linear Fitting, 600 sample point, 500 iteration, Time consuming: 70-100us

             The least-square method          RANSAC

  • Kalman Filter:
    Two dimensional coordinate tracking, System state variable is [x,y,dx,dy], prediction+update. Mean time consuming: 8us

  • MeanShift:
    Using kernel function,refactoring with Eigen3 and openMP, Test images's size is 640x480, using RGB color space. Mean time consuming:100-2000us


1. Camera calibration

  • Using opencv's own calibration tool to calculate the internal parameters of the camera, the chessboard picture has been given, fool-style operation, take a look.

Location:

	DasudaRunner/Object-Tracking/calibration_camera

Requirments:

	opencv:>=3.3.0 or >=3.0.0
	python:>=2.7
	python-opencv:

Quick Start:

 Step 1. Connecte Camera, get images containing checkerboard.

	./src$ python getChecker.py # press 's' to save image

 Step 2. I encapsulated these commands into a script file, and you can run the following command.

	./src$ sudo sh calibration_camera.sh

   Now you can get out_camera_data.yml , this is a file that contains your camera's internal reference.

 Step 3. You can run ./demo, and get corrected images.

	./src$ ./demo ../out_camera_data.yml

calibration image

   Actually, it call the function remap_image() in tracking.hpp.

	#include <opencv2/core.hpp>
	#include <opencv2/imgcodecs.hpp>
	#include <opencv2/highgui.hpp>
	#include <opencv2/opencv.hpp>
	#include <iostream>
	#include "../../../tracking.hpp"
	using namespace std;
	int main(int argc, char* argv[])
	{
		cv::VideoCapture cap;
		cap.open(0);
		wong::calibration_camera camera(argv[1]);
		cv::Mat frame,out;
		cout<<"Press any key to exit the program !"<<endl;
		for (;;){
			cap >> frame;
			camera.remap_image(frame,out);
			cv::imshow("source",frame);
			cv::imshow("corrected",out);
			if(cv::waitKey(5)>=0)
				break;
		}
	}