-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release_2.20.2' into main
- Loading branch information
Showing
5 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include <iostream> | ||
|
||
// Includes common necessary includes for development using depthai library | ||
#include "depthai/depthai.hpp" | ||
|
||
int main() { | ||
// Create pipeline | ||
dai::Pipeline pipeline; | ||
|
||
// Define source and output | ||
auto camRgb = pipeline.create<dai::node::ColorCamera>(); | ||
auto xoutVideo = pipeline.create<dai::node::XLinkOut>(); | ||
|
||
xoutVideo->setStreamName("video"); | ||
|
||
// Properties | ||
camRgb->setBoardSocket(dai::CameraBoardSocket::RGB); | ||
camRgb->setResolution(dai::ColorCameraProperties::SensorResolution::THE_4_K); | ||
camRgb->setIspScale(1, 2); | ||
camRgb->setVideoSize(1920, 1080); | ||
|
||
xoutVideo->input.setBlocking(false); | ||
xoutVideo->input.setQueueSize(1); | ||
|
||
// Linking | ||
camRgb->video.link(xoutVideo->input); | ||
|
||
// Connect to device and start pipeline | ||
dai::Device device(pipeline); | ||
|
||
auto video = device.getOutputQueue("video"); | ||
|
||
while(true) { | ||
auto videoIn = video->get<dai::ImgFrame>(); | ||
|
||
// Get BGR frame from NV12 encoded video frame to show with opencv | ||
// Visualizing the frame on slower hosts might have overhead | ||
cv::imshow("video", videoIn->getCvFrame()); | ||
|
||
int key = cv::waitKey(1); | ||
if(key == 'q' || key == 'Q') { | ||
return 0; | ||
} | ||
} | ||
return 0; | ||
} |