opencv_tutorials_t6
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
opencv_tutorials_t6 [2016/06/07 14:48] – joaomatos | opencv_tutorials_t6 [2017/05/13 17:53] (current) – [Understanding the code] acater | ||
---|---|---|---|
Line 44: | Line 44: | ||
const int FRAME_HEIGHT = 480; | const int FRAME_HEIGHT = 480; | ||
- | //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 71: | Line 71: | ||
//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 220: | Line 220: | ||
const int FRAME_HEIGHT = 480; | const int FRAME_HEIGHT = 480; | ||
- | //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 243: | Line 243: | ||
</ | </ | ||
- | The code begins with the same idea of image thresholding. Declaring the variables to be used on the Trackbars windows and defining the function to create the slider bars. You can see the commentaries | + | The code begins with the same idea of image threshold. Declaring the variables to be used on the Trackbars windows and defining the function to create the slider bars. You can see the commentaries |
Line 254: | Line 254: | ||
//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 268: | Line 268: | ||
</ | </ | ||
- | Again the same idea of the image thresholding | + | Again the same idea of the image threshold |
Line 440: | Line 440: | ||
We show the image with the web camera frame and the contour drawn using the **" | We show the image with the web camera frame and the contour drawn using the **" | ||
+ | \\ | ||
+ | \\ | ||
+ | The video below demonstrates the program running in real time. | ||
+ | {{youtube> |
opencv_tutorials_t6.1465336097.txt.gz · Last modified: by joaomatos