-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1028 from luxonis/release_2.26.0
Release 2.26.0
- Loading branch information
Showing
37 changed files
with
1,557 additions
and
73 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
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,50 @@ | ||
#include <depthai/depthai.hpp> | ||
#include <opencv2/opencv.hpp> | ||
|
||
constexpr int SHAPE = 300; | ||
|
||
int main() { | ||
dai::Pipeline p; | ||
|
||
auto camRgb = p.create<dai::node::ColorCamera>(); | ||
auto nn = p.create<dai::node::NeuralNetwork>(); | ||
auto rgbOut = p.create<dai::node::XLinkOut>(); | ||
auto cast = p.create<dai::node::Cast>(); | ||
auto castXout = p.create<dai::node::XLinkOut>(); | ||
|
||
camRgb->setPreviewSize(SHAPE, SHAPE); | ||
camRgb->setInterleaved(false); | ||
|
||
nn->setBlobPath(BLOB_PATH); | ||
|
||
rgbOut->setStreamName("rgb"); | ||
castXout->setStreamName("cast"); | ||
|
||
cast->setOutputFrameType(dai::ImgFrame::Type::BGR888p); | ||
|
||
// Linking | ||
camRgb->preview.link(nn->input); | ||
camRgb->preview.link(rgbOut->input); | ||
nn->out.link(cast->input); | ||
cast->output.link(castXout->input); | ||
|
||
dai::Device device(p); | ||
auto qCam = device.getOutputQueue("rgb", 4, false); | ||
auto qCast = device.getOutputQueue("cast", 4, false); | ||
|
||
while(true) { | ||
auto inCast = qCast->get<dai::ImgFrame>(); | ||
auto inRgb = qCam->get<dai::ImgFrame>(); | ||
|
||
if(inCast && inRgb) { | ||
cv::imshow("Blur", inCast->getCvFrame()); | ||
cv::imshow("Original", inRgb->getCvFrame()); | ||
} | ||
|
||
if(cv::waitKey(1) == 'q') { | ||
break; | ||
} | ||
} | ||
|
||
return 0; | ||
} |
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,63 @@ | ||
#include <depthai/depthai.hpp> | ||
#include <opencv2/opencv.hpp> | ||
|
||
constexpr int SHAPE = 300; | ||
|
||
int main() { | ||
dai::Pipeline p; | ||
|
||
auto camRgb = p.create<dai::node::ColorCamera>(); | ||
auto left = p.create<dai::node::MonoCamera>(); | ||
auto right = p.create<dai::node::MonoCamera>(); | ||
auto manipLeft = p.create<dai::node::ImageManip>(); | ||
auto manipRight = p.create<dai::node::ImageManip>(); | ||
auto nn = p.create<dai::node::NeuralNetwork>(); | ||
auto cast = p.create<dai::node::Cast>(); | ||
auto castXout = p.create<dai::node::XLinkOut>(); | ||
|
||
camRgb->setPreviewSize(SHAPE, SHAPE); | ||
camRgb->setInterleaved(false); | ||
camRgb->setColorOrder(dai::ColorCameraProperties::ColorOrder::BGR); | ||
|
||
left->setCamera("left"); | ||
left->setResolution(dai::MonoCameraProperties::SensorResolution::THE_400_P); | ||
manipLeft->initialConfig.setResize(SHAPE, SHAPE); | ||
manipLeft->initialConfig.setFrameType(dai::ImgFrame::Type::BGR888p); | ||
|
||
right->setCamera("right"); | ||
right->setResolution(dai::MonoCameraProperties::SensorResolution::THE_400_P); | ||
manipRight->initialConfig.setResize(SHAPE, SHAPE); | ||
manipRight->initialConfig.setFrameType(dai::ImgFrame::Type::BGR888p); | ||
|
||
nn->setBlobPath(BLOB_PATH); | ||
nn->setNumInferenceThreads(2); | ||
|
||
castXout->setStreamName("cast"); | ||
cast->setOutputFrameType(dai::ImgFrame::Type::BGR888p); | ||
|
||
// Linking | ||
left->out.link(manipLeft->inputImage); | ||
right->out.link(manipRight->inputImage); | ||
manipLeft->out.link(nn->inputs["img1"]); | ||
camRgb->preview.link(nn->inputs["img2"]); | ||
manipRight->out.link(nn->inputs["img3"]); | ||
nn->out.link(cast->input); | ||
cast->output.link(castXout->input); | ||
|
||
// Pipeline is defined, now we can connect to the device | ||
dai::Device device(p); | ||
auto qCast = device.getOutputQueue("cast", 4, false); | ||
|
||
while(true) { | ||
auto inCast = qCast->get<dai::ImgFrame>(); | ||
if(inCast) { | ||
cv::imshow("Concated frames", inCast->getCvFrame()); | ||
} | ||
|
||
if(cv::waitKey(1) == 'q') { | ||
break; | ||
} | ||
} | ||
|
||
return 0; | ||
} |
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,66 @@ | ||
#include <depthai/depthai.hpp> | ||
#include <filesystem> | ||
#include <opencv2/opencv.hpp> | ||
|
||
constexpr int SHAPE = 720; | ||
|
||
int main() { | ||
dai::Pipeline p; | ||
|
||
auto camRgb = p.create<dai::node::ColorCamera>(); | ||
auto nn = p.create<dai::node::NeuralNetwork>(); | ||
auto script = p.create<dai::node::Script>(); | ||
auto rgbXout = p.create<dai::node::XLinkOut>(); | ||
auto cast = p.create<dai::node::Cast>(); | ||
auto castXout = p.create<dai::node::XLinkOut>(); | ||
|
||
camRgb->setVideoSize(SHAPE, SHAPE); | ||
camRgb->setPreviewSize(SHAPE, SHAPE); | ||
camRgb->setInterleaved(false); | ||
|
||
nn->setBlobPath(BLOB_PATH); | ||
|
||
script->setScript(R"( | ||
old = node.io['in'].get() | ||
while True: | ||
frame = node.io['in'].get() | ||
node.io['img1'].send(old) | ||
node.io['img2'].send(frame) | ||
old = frame | ||
)"); | ||
|
||
rgbXout->setStreamName("rgb"); | ||
castXout->setStreamName("cast"); | ||
cast->setOutputFrameType(dai::RawImgFrame::Type::GRAY8); | ||
|
||
// Linking | ||
camRgb->preview.link(script->inputs["in"]); | ||
script->outputs["img1"].link(nn->inputs["img1"]); | ||
script->outputs["img2"].link(nn->inputs["img2"]); | ||
camRgb->video.link(rgbXout->input); | ||
nn->out.link(cast->input); | ||
cast->output.link(castXout->input); | ||
|
||
// Pipeline is defined, now we can connect to the device | ||
dai::Device device(p); | ||
auto qCam = device.getOutputQueue("rgb", 4, false); | ||
auto qCast = device.getOutputQueue("cast", 4, false); | ||
|
||
while(true) { | ||
auto colorFrame = qCam->get<dai::ImgFrame>(); | ||
if(colorFrame) { | ||
cv::imshow("Color", colorFrame->getCvFrame()); | ||
} | ||
|
||
auto inCast = qCast->get<dai::ImgFrame>(); | ||
if(inCast) { | ||
cv::imshow("Diff", inCast->getCvFrame()); | ||
} | ||
|
||
if(cv::waitKey(1) == 'q') { | ||
break; | ||
} | ||
} | ||
|
||
return 0; | ||
} |
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
Oops, something went wrong.