User Tools

Site Tools


opencv_tutorials_t7

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
opencv_tutorials_t7 [2016/06/07 15:43] joaomatosopencv_tutorials_t7 [2016/06/07 15:52] joaomatos
Line 4: Line 4:
  
  I recommend you to type the code on your own to get familiarized with the program language. If you have trouble , the original code is attached bellow ( Running on Visual Studio 2015 + OpenCV 3.1 ) * Check the installation guide to make sure that you linked all the OpenCV modules to your Visual Studio.  I recommend you to type the code on your own to get familiarized with the program language. If you have trouble , the original code is attached bellow ( Running on Visual Studio 2015 + OpenCV 3.1 ) * Check the installation guide to make sure that you linked all the OpenCV modules to your Visual Studio.
 +
 +{{::track_by_image_moments.rar| Track Object by image moments}}
  
 ---- ----
 ===== Tracking an object using image moments ===== ===== Tracking an object using image moments =====
  
 +{{ ::track_moment.jpg?direct |}}
  
 <Code C++ linenums:1> <Code C++ linenums:1>
Line 546: Line 549:
  Here we create the on/off toggles to use the morphological transformations (by pressing 'm') and to run the tracking algorithm (by pressing 't') . Each time 'm' or 't' is pressed the Booleans useTrack and useFeatures will change values from TRUE to FALSE and vice-versa. Every time these values are TRUE , it will enter inside the conditional loop that will call the respective functions , **"DilateAndErode()"** and **"TrackObject()"**.  Here we create the on/off toggles to use the morphological transformations (by pressing 'm') and to run the tracking algorithm (by pressing 't') . Each time 'm' or 't' is pressed the Booleans useTrack and useFeatures will change values from TRUE to FALSE and vice-versa. Every time these values are TRUE , it will enter inside the conditional loop that will call the respective functions , **"DilateAndErode()"** and **"TrackObject()"**.
  
 +
 +----
 +<Code C++ linenums:226>
 +                //show frames 
 + imshow("Threshold Image", threshold);
 + imshow("Live Web Cam", coloredimage);
 + imshow("HSV Image", HSV);
    
 + key = waitKey(25);
 + 
 + }
 + 
 + 
 + 
 + return 0;
 +}
 + 
 +</Code>
 +
 + Finally we open and display three different windows to show the Live web cam video , the threshold version and the HSV version. The key value is updated using **"key = waitKey(25)"**. And our program is done !
opencv_tutorials_t7.txt · Last modified: 2016/06/07 15:57 by joaomatos