opencv_tutorials_t7
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
opencv_tutorials_t7 [2016/06/07 15:43] – joaomatos | opencv_tutorials_t7 [2016/06/07 15:57] (current) – 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. | ||
+ | |||
+ | {{:: | ||
---- | ---- | ||
===== Tracking an object using image moments ===== | ===== Tracking an object using image moments ===== | ||
+ | {{ :: | ||
<Code C++ linenums: | <Code C++ linenums: | ||
Line 54: | Line 57: | ||
} | } | ||
- | //Function to create a window with the Trackbars to apply the Thresholding. | + | //Function to create a window with the Trackbars to apply the Threshold. |
void createTrackbars() { | void createTrackbars() { | ||
Line 81: | Line 84: | ||
//Defining the erode and dilate properties | //Defining the erode and dilate properties | ||
//the erode element chosen here is a 3x3 piexels rectangle. | //the erode element chosen here is a 3x3 piexels rectangle. | ||
- | //Change the Size argument to optimize your thresholding. | + | //Change the Size argument to optimize your threshold. |
- | //dilate with 8x8 size element to make the thresholding | + | //dilate with 8x8 size element to make the threshold |
Mat erodeElement = getStructuringElement(MORPH_RECT, | Mat erodeElement = getStructuringElement(MORPH_RECT, | ||
Line 298: | Line 301: | ||
<Code C++ linenums: | <Code C++ linenums: | ||
- | //Function to create a window with the Trackbars to apply the Thresholding. | + | //Function to create a window with the Trackbars to apply the Threshold. |
void createTrackbars() { | void createTrackbars() { | ||
Line 329: | Line 332: | ||
//Defining the erode and dilate properties | //Defining the erode and dilate properties | ||
//the erode element chosen here is a 3x3 piexels rectangle. | //the erode element chosen here is a 3x3 piexels rectangle. | ||
- | //Change the Size argument to optimize your thresholding. | + | //Change the Size argument to optimize your threshold. |
- | //dilate with 8x8 size element to make the thresholding | + | //dilate with 8x8 size element to make the threshold |
Mat erodeElement = getStructuringElement(MORPH_RECT, | Mat erodeElement = getStructuringElement(MORPH_RECT, | ||
Line 546: | Line 549: | ||
Here we create the on/off toggles to use the morphological transformations (by pressing ' | Here we create the on/off toggles to use the morphological transformations (by pressing ' | ||
+ | |||
+ | ---- | ||
+ | <Code C++ linenums: | ||
+ | //show frames | ||
+ | imshow(" | ||
+ | imshow(" | ||
+ | imshow(" | ||
+ | key = waitKey(25); | ||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | return 0; | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | |
opencv_tutorials_t7.1465339415.txt.gz · Last modified: by joaomatos