Wiki

Clone wiki

opencv_development / Home

Welcome

Welcome to the Visual Computing Project using OpenCV library for Computer Vision. This project also contains Tutorials I learned using various sources.

The various projects are created for the purpose of learning and finishing a programming exercise.

Project Dependencies

  1. OpenCV library must be installed in the OS
  2. Knowledge of C++ are required.
  3. C++ compilers (eg. gcc) installed in the OS.
  4. CMake installed.

Project Cloning

Clone this GIT repositories using the link given below

Go ahead and try:

$ git clone https://iankits@bitbucket.org/iankits/opencv_development.git

GIT Branches

  • master :- Lastest working version of the project
  • development :- Lastest development version and stable source will be merged to the master branch.

Repo Contents

The repository contents reflects my different tries to solve the problem statement in the section "Main Task Description"

opencv_development/ contains the project folder mainly targetted to solve the problem statement described in next section.

  • template_tracking_project_solution project directory contains working solution for the problem statement. Though, it is not the best solution but it is good enough for the given time and knowledge I gathered during working for two weeks (part-time) on the problem statement which includes learning OpenCV visual computing from scratch. Sample video for testing the tracking of the object (turtle) can be downloaded from https://www.dropbox.com/sh/t40lp3qphao7dfy/kCCnYSo_Zl#f:Video%2095.mp4
  • haartraining_turtle project was my first try to comeup with the solution and most time consuming as it needed lots of effort to buildup the haartraining environment ready and create samples. It worked upto certain extent but not tracking the object correctly as there are lots of disturbance due to water and other distraction the video. It is good for face recognition of static pattern. And also need lots of data to for haartraining in openCV.

In opencv_development/tutorials/, you can find all the projects which are mostly copied directly from various OpenCV + C++ tutorials and modified to use the given video samples in the project.

  • first_opencv_project (Copied: First project to test the OpenCV enviroment setup)
  • objectTrackingTutorial (Copied: to understand the object Tracking functionality)
  • captureFrames(Written by me)
  • tracking_object_from_video (Copied: To learn and understand detection of object using color HSV on the video)
  • detect_contours (Copied: To learn and understand contours detection on the video)
  • histogram_tutorial_opencv (Copied: To learn and understand histogram in openCV)

Main Task Description

The repository to the main project is opencv_development/template_tracking_project_solution/

The problem statement:

A turtle is placed into a basin. Inside the basin are two shelters. On the wall next to each shelter a visual stimulus is located. The goal of the experiment is for the turtle to recognize the visual cue (grating), and use this cue to walk into the correct shelter (goal) and not the distractor.

As you can see this is not the average kind of object detection: we are dealing with moving water, reflections of light in the water, and obstacles in the tank. But luckily our object is moving slowly :)

From a scientific point of view, we are interested to track the movement of the animal inside the tank as precisely as possible (location, head movements, eye position, etc).

What we ask you to do, is to write a program that can satisfy the following specifications:

  • locate animal correctly throughout the video, and return a list of x & y coordinates (center of gravity or extremities) for every frame.
  • return the speed, the animal orientation and animal's head direction in each frame.
  • return a list of turning points (pivot points) throughout a trial (x, y, time-stamp).
  • return list of time-stamps for every contact event; that is, every time the animal is near the entrance of a shelter.
  • generic solution with minimal user interaction (ideally your program should just be given the file name and do everything else automatically).
  • error rate of at most 5%.

OpenCV with C++ Tutorials

Nice links to some tutorials in the answer in Stackoverflow question:

Some Youtube Tutorials:

Haartraining Tutorials:

Template Matching and Contour Tutorials:

Updated