User Tools

Site Tools


opencv_tutorials_t1

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
opencv_tutorials_t1 [2016/06/06 14:56] joaomatosopencv_tutorials_t1 [2017/05/13 16:55] (current) – [Using your Webcam Image] acater
Line 8: Line 8:
  
 {{::basic_operations_using_webcam.rar|Basic operations using webcam}} {{::basic_operations_using_webcam.rar|Basic operations using webcam}}
 +
 +
  
 ---- ----
 +===== Basic Operations =====
 +
 +{{ ::basic_op.jpg?direct |}}
  
 <Code:c++ linenums:1> <Code:c++ linenums:1>
Line 90: Line 95:
 **Line 1 to 11**: **Line 1 to 11**:
  
- First we have to include the modules from OpenCV that will be used on the program. Each modules has its own functions and Variables type. (For example: the Mat variable type , the cvtColor function , the imshow function , etc... - each one is inside of one OpenCV module , that needs to be included in order to make the program compile).+ First we have to include the modules from OpenCV that will be used on the program. Each modules has its own functions and Variables type. (For example: the Mat variable type , the cvtColor function , the imshow function , etc... - each one is inside of one OpenCV module , that needs to be included in order to make the program compile). The "usingnamespace" is convenient to declare always because it avoid us to type cv::OpenCVFunction  or std::StandardFunction always before using the function for the opencv scope or standard scope.
  
  
Line 268: Line 273:
 </Code> </Code>
  
- We changed the "imread" for the "VideoCapture" which will capture from your default video source (capture(0)) and the "resize" for the "capture.set" function.+ We changed the **"imread"** for the **"VideoCapture"** which will capture from your default video source (capture(0)) and the **"resize"** for the **"capture.set"** function.
  
  
Line 281: Line 286:
  capture >> colorimage;  capture >> colorimage;
 </Code> </Code>
-The loop will run until the "q" key on the keyboard is pressed (we need to declare the key variable first ). The video shown on the images will be a collection of frames took from your webcam ( using the assign capture >> colorimage) the color image will store the webcam frame . The rest of the code is the same thing as the last code , converting to gray scale and HSV.  At the end we just need to assign the "waitKey" command to the key variable and close the loop.+The loop will run until the "q" key on the keyboard is pressed (we need to declare the key variable first ). The video shown on the images will be a collection of frames took from your webcam ( using the assign **capture >> colorimage**) the color image will store the webcam frame . The rest of the code is the same thing as the last code , converting to gray scale and HSV.  At the end we just need to assign the **"waitKey"** command to the key variable and close the loop. 
 + 
 +\\ 
 +The video below demonstrates the program as it is run in real time. 
 +\\ 
 +{{youtube>PqW0GsMVRd0?medium}}
opencv_tutorials_t1.1465250209.txt.gz · Last modified: by joaomatos