pegasus_cam_cv
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pegasus_cam_cv [2019/03/08 04:33] – dwallace | pegasus_cam_cv [2019/03/08 04:37] (current) – dwallace | ||
---|---|---|---|
Line 36: | Line 36: | ||
To start, we import necessary libraries, most important being the Aruco library. | To start, we import necessary libraries, most important being the Aruco library. | ||
+ | \\ | ||
<code python> | <code python> | ||
import sys | import sys | ||
Line 43: | Line 43: | ||
import aruco | import aruco | ||
</ | </ | ||
+ | \\ | ||
The main loop with comments can be seen below: | The main loop with comments can be seen below: | ||
+ | \\ | ||
<code python> | <code python> | ||
if __name__ == ' | if __name__ == ' | ||
Line 99: | Line 99: | ||
ret, frame = cap.read() | ret, frame = cap.read() | ||
</ | </ | ||
+ | \\ | ||
This code should produce a result similar to the video below. | This code should produce a result similar to the video below. | ||
+ | \\ | ||
{{ youtube> | {{ youtube> | ||
\\ | \\ | ||
Line 108: | Line 108: | ||
This program is made to detect faces in the frame using the Haar Cascades as the face classifier. The code is implemented in Python, and the full code with comments explaining the usage can be seen below: | This program is made to detect faces in the frame using the Haar Cascades as the face classifier. The code is implemented in Python, and the full code with comments explaining the usage can be seen below: | ||
+ | \\ | ||
<code python> | <code python> | ||
import numpy as np | import numpy as np | ||
Line 163: | Line 163: | ||
cv2.destroyAllWindows() | cv2.destroyAllWindows() | ||
</ | </ | ||
- | + | \\ | |
- | After implemtnign | + | After implementing |
+ | \\ | ||
{{ youtube> | {{ youtube> | ||
\\ | \\ | ||
Line 173: | Line 173: | ||
This program is used to track a red ball within the frame of the stream. This color can be modified in the code for other applications. It should be noted that this code shows an alternative way of import the Pegasus Cam stream into OpenCV by using a parameter for the http stream on the command line. With the use of parameter files, this would allow for a " | This program is used to track a red ball within the frame of the stream. This color can be modified in the code for other applications. It should be noted that this code shows an alternative way of import the Pegasus Cam stream into OpenCV by using a parameter for the http stream on the command line. With the use of parameter files, this would allow for a " | ||
+ | \\ | ||
<code python> | <code python> | ||
# USAGE | # USAGE | ||
Line 283: | Line 284: | ||
cv2.destroyAllWindows() | cv2.destroyAllWindows() | ||
</ | </ | ||
+ | \\ | ||
After implementing the code above, you should get results similar to the video below. | After implementing the code above, you should get results similar to the video below. | ||
+ | \\ | ||
{{ youtube> | {{ youtube> | ||
\\ | \\ |
pegasus_cam_cv.txt · Last modified: 2019/03/08 04:37 by dwallace