Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.14.0 #311

Merged
merged 90 commits into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
2e0d663
Added Node Input options and some tests
themarpe Sep 18, 2021
50a3a55
Added IO groups and refactored IO references
themarpe Sep 20, 2021
e4ff1fb
Updated waitForMessage API and applied across nodes
themarpe Sep 22, 2021
0e5c4c8
Removed deprecated usage and added correct output for DetectionNetwor…
themarpe Sep 22, 2021
88c53e6
Merge branch 'develop' into neuralnetwork_multiple_inputs
themarpe Oct 5, 2021
efde266
Added libnop dependency and unified serialization
themarpe Oct 15, 2021
7ca20bb
Refactored Nodes to allow for arbitrary properties and removed issues…
themarpe Oct 18, 2021
6344992
Merge branch 'develop' into libnop_serialization
themarpe Oct 18, 2021
c5709db
Added CRTP to Nodes
themarpe Oct 19, 2021
d6f7e5e
Merge branch 'develop' into neuralnetwork_multiple_inputs
themarpe Oct 19, 2021
1fd51e5
Merge branch 'node_crtp' into develop_refactor
themarpe Oct 19, 2021
8b027be
Fixed a node crtp issue
themarpe Oct 20, 2021
4ada80d
Fixed setNumFramesPool for VideoEncoder node
themarpe Oct 27, 2021
60135f7
Override XLink wait for bootup/connect timeouts with env vars:
alex-luxonis Nov 2, 2021
67cb23f
Fix strncpy build warning:
alex-luxonis Nov 2, 2021
b96f806
Warn if watchdog is disabled, or value overriden.
alex-luxonis Nov 2, 2021
c9eeb15
Initial version of temporal + thresholding filter
SzabolcsGergely Nov 23, 2021
487b2ab
Add specle filter
SzabolcsGergely Nov 24, 2021
32aac1b
Clangformat bootloader example
SzabolcsGergely Nov 24, 2021
290e8a6
Add spatial filter
SzabolcsGergely Nov 29, 2021
143c0fe
Added clock
themarpe Nov 30, 2021
8858e5c
Merge remote-tracking branch 'origin/develop' into HEAD
SzabolcsGergely Dec 1, 2021
b5f0a83
Add configurable number of shaves for stereo postprocessing
SzabolcsGergely Dec 1, 2021
b0cc220
Merge remote-tracking branch 'origin/develop' into HEAD
SzabolcsGergely Dec 1, 2021
7f12c61
Updated XLink with MinGW fixes
themarpe Dec 1, 2021
250c403
Add decimation filter
SzabolcsGergely Dec 2, 2021
4bdc577
Merge branch 'xlink_mingw_fix' into develop
themarpe Dec 2, 2021
5dda7d9
Merge branch 'depthai_clock' into develop
themarpe Dec 2, 2021
b5794f3
Add configurable decimation filter modes: pixel skipping/non zero med…
SzabolcsGergely Dec 3, 2021
2bdb183
Apply thresholding filter on disparity map if depth is not enabled
SzabolcsGergely Dec 3, 2021
97e3c9b
Updated FW with YoloV5 support and stability improvements
themarpe Dec 6, 2021
bbe1bb3
Merge pull request #295 from luxonis/fw_yolov5_and_stability
themarpe Dec 6, 2021
b98afc5
add cmake vars for local depthai-bootloader/shared
diablodale Dec 7, 2021
558765c
Merge pull request #296 from diablodale/fix-264-cmake-shared-vars
themarpe Dec 7, 2021
721832d
Merge remote-tracking branch 'origin/develop' into HEAD
SzabolcsGergely Dec 8, 2021
bd242de
Update FW; add default stereo presets; add configurable HW resources
SzabolcsGergely Dec 9, 2021
765807e
Update FW, fix docs build
SzabolcsGergely Dec 9, 2021
0b2e945
Updated shared
themarpe Dec 10, 2021
97da2c9
fix xlink cmake install for local, shared, and static
diablodale Dec 11, 2021
7c62d48
Add support for runtiem depth aligment mode; improve API
SzabolcsGergely Dec 13, 2021
82ad103
Add default preset mode to StereoDepth constructor
SzabolcsGergely Dec 13, 2021
a40d7b9
Change all examples to use setDefaultProfilePreset
SzabolcsGergely Dec 13, 2021
5fcd5a7
Add depth post processing example
SzabolcsGergely Dec 13, 2021
06d2409
FW update: don't apply threshold filtering on confidence map
SzabolcsGergely Dec 13, 2021
1cdf23a
FW: Edge case fix for RGB aligment
SzabolcsGergely Dec 13, 2021
bb28ec9
Merge pull request #298 from diablodale/fix-xlink-local-install
themarpe Dec 13, 2021
355fd68
Fixed exporting XLink when not using a local version
themarpe Dec 13, 2021
566a6bf
Fixed XLink dependency in config mode
themarpe Dec 13, 2021
1463ceb
Fix broken Windows CI
themarpe Dec 13, 2021
2859da2
Merge branch 'stubs_improvements' into develop
themarpe Dec 14, 2021
a86e266
Merge remote-tracking branch 'origin/develop' into HEAD
SzabolcsGergely Dec 14, 2021
c4ead22
Update shared w/ stubgen fixes
SzabolcsGergely Dec 14, 2021
99649a5
Update FW with improved resource allocation for RGB aligment; improve…
SzabolcsGergely Dec 14, 2021
dbe6370
Update FW to latest develop
SzabolcsGergely Dec 14, 2021
e099d27
Merge pull request #274 from luxonis/stereo_post_processing
SzabolcsGergely Dec 14, 2021
10cebec
Merge branch 'develop' into develop_refactor
themarpe Dec 14, 2021
bf2e531
Exposed max serialized metadata size
themarpe Dec 14, 2021
733ee31
fix 2 for xlink local cmake
diablodale Dec 14, 2021
7db241e
Merge pull request #301 from diablodale/fix-xlink-local-install-v2
themarpe Dec 14, 2021
938ac45
Added incoming message parse timing to trace level debugging
themarpe Dec 15, 2021
b368b55
Merge branch 'develop' into develop_refactor
themarpe Dec 16, 2021
8e493b5
Updated shared
themarpe Dec 16, 2021
af07a37
Updated shared
themarpe Dec 16, 2021
b2006f8
Merge branch 'develop_refactor' into develop
themarpe Dec 17, 2021
c84d44f
NNData serialize fix (#305)
themarpe Dec 17, 2021
f17b4b3
Added MSVC preprocessor conformance flag
themarpe Dec 18, 2021
b4b366e
Updated FW to match shared
themarpe Dec 18, 2021
eff3262
Bump Windows SDK to 10.0.18362.0 with conforming preprocessor support…
themarpe Dec 19, 2021
66f9e5a
Merge remote-tracking branch 'origin/main' into HEAD
SzabolcsGergely Dec 20, 2021
ab28bbe
Adds rgb/depth weight slider to rgb_depth_aligned example
SzabolcsGergely Dec 20, 2021
f1c3777
FW fix for Stereo HW desync when extended is enabled
SzabolcsGergely Dec 20, 2021
29df69f
Fix typo: assigment -> assignment
SzabolcsGergely Dec 21, 2021
e44bb6c
FeatureTracker: Add support for 4k/12MP inputs
SzabolcsGergely Dec 22, 2021
bba5961
Set pullup for IMU wakeup pin
SzabolcsGergely Dec 23, 2021
77ac1fe
Update FW; wakeup driven high
SzabolcsGergely Dec 23, 2021
ad5befe
Updated XLink
themarpe Dec 26, 2021
301a97c
Merge remote-tracking branch 'origin/main' into HEAD
SzabolcsGergely Dec 27, 2021
7bc4d3a
Fix serialization of spatial img data
SzabolcsGergely Dec 27, 2021
61a6161
Merge 'origin/develop' into connect_timeout_override
alex-luxonis Dec 28, 2021
09d99ab
`DEPTHAI_INIT_WATCHDOG` env var to set initial delay [ms] for the dev…
alex-luxonis Dec 28, 2021
a35bdb1
clangformat changes,
alex-luxonis Dec 28, 2021
6453a10
Rename env var DEPTHAI_INIT_WATCHDOG -> DEPTHAI_WATCHDOG_INITIAL_DELAY
alex-luxonis Dec 28, 2021
84f7c69
Merge pull request #312 from luxonis/connect_timeout_override
alex-luxonis Dec 29, 2021
274bdd6
Update shared/FW
SzabolcsGergely Dec 30, 2021
78bbc38
Bump Hunter to add support for VS2022
themarpe Dec 30, 2021
748f95f
Merge branch 'develop' of github.com:luxonis/depthai-core into develop
themarpe Dec 30, 2021
a516cd5
Fixed updated Hunter usage
themarpe Dec 30, 2021
6fae450
Updated libnop
themarpe Dec 31, 2021
3ca0373
Fixed script json communication example
themarpe Jan 4, 2022
9710c72
Release v2.14.0
SzabolcsGergely Jan 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'develop' into neuralnetwork_multiple_inputs
  • Loading branch information
themarpe committed Oct 5, 2021
commit 88c53e6959215d1d0d8294c668fe169f9ab5a098
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceSideConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "b9caa598c028d53ffaa2abcf4082c8bf04f660bd")
set(DEPTHAI_DEVICE_SIDE_COMMIT "83ae88bed547aec394e94480df562740e5f3d77b")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
3 changes: 1 addition & 2 deletions examples/src/bootloader_version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ int main(int argc, char** argv) {
bool res = false;
dai::DeviceInfo info;
std::tie(res, info) = dai::DeviceBootloader::getFirstAvailableDevice();
std::string path;

if(res) {
std::cout << "Found device with name: " << info.desc.name << std::endl;
dai::DeviceBootloader bl(info, path);
dai::DeviceBootloader bl(info);
std::cout << "Version: " << bl.getVersion().toString() << std::endl;
} else {
std::cout << "No devices found" << std::endl;
Expand Down
99 changes: 37 additions & 62 deletions examples/src/calibration_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
#include "depthai-shared/common/EepromData.hpp"
#include "depthai/depthai.hpp"

void printMatrix(std::vector<std::vector<float>> matrix) {
using namespace std;
std::string out = "[";
for(auto row : matrix) {
out += "[";
for(auto val : row) out += to_string(val) + ", ";
out = out.substr(0, out.size() - 2) + "]\n";
}
out = out.substr(0, out.size() - 1) + "]\n\n";
cout << out;
}

int main(int argc, char** argv) {
using namespace std;

Expand All @@ -18,92 +30,55 @@ int main(int argc, char** argv) {
std::vector<std::vector<float>> intrinsics;
int width, height;

cout << "Intrinsics from defaultIntrinsics function" << endl;
cout << "Intrinsics from defaultIntrinsics function:" << endl;
std::tie(intrinsics, width, height) = calibData.getDefaultIntrinsics(dai::CameraBoardSocket::RIGHT);
printMatrix(intrinsics);

for(auto row : intrinsics) {
for(auto val : row) cout << val << " ";
cout << endl;
}
cout << "Width: " << width << endl;
cout << "Height: " << height << endl;

cout << "Width -> " << width << endl;
cout << "Height -> " << height << endl;
cout << "Stereo baseline distance: " << calibData.getBaselineDistance() << " cm" << endl;

cout << "Stereo baseline distance -> " << calibData.getBaselineDistance() << " cm" << endl;
cout << "Mono FOV from camera specs: " << calibData.getFov(dai::CameraBoardSocket::LEFT)
<< ", calculated FOV: " << calibData.getFov(dai::CameraBoardSocket::LEFT, false) << endl;

cout << "Intrinsics from getCameraIntrinsics function full resolution ->" << endl;
cout << "Intrinsics from getCameraIntrinsics function full resolution:" << endl;
intrinsics = calibData.getCameraIntrinsics(dai::CameraBoardSocket::RIGHT);
printMatrix(intrinsics);

for(auto row : intrinsics) {
for(auto val : row) cout << val << " ";
cout << endl;
}

cout << "Intrinsics from getCameraIntrinsics function 1280 x 720 ->" << endl;
cout << "Intrinsics from getCameraIntrinsics function 1280 x 720:" << endl;
intrinsics = calibData.getCameraIntrinsics(dai::CameraBoardSocket::RIGHT, 1280, 720);
printMatrix(intrinsics);

for(auto row : intrinsics) {
for(auto val : row) cout << val << " ";
cout << endl;
}

cout << "Intrinsics from getCameraIntrinsics function 720 x 450 ->" << endl;
cout << "Intrinsics from getCameraIntrinsics function 720 x 450:" << endl;
intrinsics = calibData.getCameraIntrinsics(dai::CameraBoardSocket::RIGHT, 720);
printMatrix(intrinsics);

for(auto row : intrinsics) {
for(auto val : row) cout << val << " ";
cout << endl;
}

cout << "Intrinsics from getCameraIntrinsics function 600 x 1280 ->" << endl;
cout << "Intrinsics from getCameraIntrinsics function 600 x 1280:" << endl;
intrinsics = calibData.getCameraIntrinsics(dai::CameraBoardSocket::RIGHT, 600, 1280);

for(auto row : intrinsics) {
for(auto val : row) cout << val << " ";
cout << endl;
}
printMatrix(intrinsics);

std::vector<std::vector<float>> extrinsics;

cout << "Extrinsics from left->right test ->" << endl;
cout << "Extrinsics from left->right test:" << endl;
extrinsics = calibData.getCameraExtrinsics(dai::CameraBoardSocket::LEFT, dai::CameraBoardSocket::RIGHT);
printMatrix(extrinsics);

for(auto row : extrinsics) {
for(auto val : row) cout << val << " ";
cout << endl;
}

cout << "Extrinsics from right->left test ->" << endl;
cout << "Extrinsics from right->left test:" << endl;
extrinsics = calibData.getCameraExtrinsics(dai::CameraBoardSocket::RIGHT, dai::CameraBoardSocket::LEFT);
printMatrix(extrinsics);

for(auto row : extrinsics) {
for(auto val : row) cout << val << " ";
cout << endl;
}

cout << "Extrinsics from right->rgb test ->" << endl;
cout << "Extrinsics from right->rgb test:" << endl;
extrinsics = calibData.getCameraExtrinsics(dai::CameraBoardSocket::RIGHT, dai::CameraBoardSocket::RGB);
printMatrix(extrinsics);

for(auto row : extrinsics) {
for(auto val : row) cout << val << " ";
cout << endl;
}

cout << "Extrinsics from rgb->right test ->" << endl;
cout << "Extrinsics from rgb->right test:" << endl;
extrinsics = calibData.getCameraExtrinsics(dai::CameraBoardSocket::RGB, dai::CameraBoardSocket::RIGHT);
printMatrix(extrinsics);

for(auto row : extrinsics) {
for(auto val : row) cout << val << " ";
cout << endl;
}

cout << "Extrinsics from left->rgb test ->" << endl;
cout << "Extrinsics from left->rgb test:" << endl;
extrinsics = calibData.getCameraExtrinsics(dai::CameraBoardSocket::LEFT, dai::CameraBoardSocket::RGB);

for(auto row : extrinsics) {
for(auto val : row) cout << val << " ";
cout << endl;
}
printMatrix(extrinsics);

return 0;
}
2 changes: 1 addition & 1 deletion examples/src/depth_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main() {
auto inDepth = q->get<dai::ImgFrame>();
auto frame = inDepth->getFrame();
// Normalization for better visualization
frame.convertTo(frame, CV_8UC1, 255 / depth->getMaxDisparity());
frame.convertTo(frame, CV_8UC1, 255 / depth->initialConfig.getMaxDisparity());

cv::imshow("disparity", frame);

Expand Down
32 changes: 20 additions & 12 deletions examples/src/flash_bootloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <string>

#include "depthai/depthai.hpp"
#include "depthai/xlink/XLinkConnection.hpp"

int main(int argc, char** argv) {
using namespace std::chrono;
Expand All @@ -19,14 +20,6 @@ int main(int argc, char** argv) {
}
}

std::cout << "Warning! Flashing bootloader can potentially soft brick your device and should be done with caution." << std::endl;
std::cout << "Do not unplug your device while the bootloader is flashing." << std::endl;
std::cout << "Type 'y' and press enter to proceed, otherwise exits: ";
if(std::cin.get() != 'y') {
std::cout << "Prompt declined, exiting..." << std::endl;
return -1;
}

bool found = false;
dai::DeviceInfo info;
std::tie(found, info) = dai::DeviceBootloader::getFirstAvailableDevice();
Expand All @@ -35,13 +28,28 @@ int main(int argc, char** argv) {
return -1;
}

bool hasBootloader = (info.state == X_LINK_BOOTLOADER);
if(hasBootloader) {
std::cout << "Warning! Flashing bootloader can potentially soft brick your device and should be done with caution." << std::endl;
std::cout << "Do not unplug your device while the bootloader is flashing." << std::endl;
std::cout << "Type 'y' and press enter to proceed, otherwise exits: ";
if(std::cin.get() != 'y') {
std::cout << "Prompt declined, exiting..." << std::endl;
return -1;
}
}

// Open DeviceBootloader and allow flashing bootloader
std::cout << "Booting latest bootloader first, will take a tad longer..." << std::endl;
dai::DeviceBootloader bl(info, true);
auto currentBlType = bl.getType();

// Check if bootloader type is the same
if(blType != dai::DeviceBootloader::Type::AUTO && currentBlType != blType) {
if(blType == dai::DeviceBootloader::Type::AUTO) {
blType = currentBlType;
}

// Check if bootloader type is the same, if already booted by bootloader (not in USB recovery mode)
if(currentBlType != blType && hasBootloader) {
std::cout << "Are you sure you want to flash '" << blType << "' bootloader over current '" << currentBlType << "' bootloader?" << std::endl;
std::cout << "Type 'y' and press enter to proceed, otherwise exits: ";
std::cin.ignore();
Expand All @@ -54,11 +62,11 @@ int main(int argc, char** argv) {
// Create a progress callback lambda
auto progress = [](float p) { std::cout << "Flashing Progress..." << p * 100 << "%" << std::endl; };

std::cout << "Flashing " << currentBlType << " bootloader..." << std::endl;
std::cout << "Flashing " << blType << " bootloader..." << std::endl;
auto t1 = steady_clock::now();
bool success = false;
std::string message;
std::tie(success, message) = bl.flashBootloader(dai::DeviceBootloader::Memory::FLASH, currentBlType, progress);
std::tie(success, message) = bl.flashBootloader(dai::DeviceBootloader::Memory::FLASH, blType, progress);
if(success) {
std::cout << "Flashing successful. Took " << duration_cast<milliseconds>(steady_clock::now() - t1).count() << "ms" << std::endl;
} else {
Expand Down
22 changes: 1 addition & 21 deletions examples/src/mono_depth_mobilenetssd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ static const std::vector<std::string> labelMap = {"background", "aeroplane", "bi
"car", "cat", "chair", "cow", "diningtable", "dog", "horse",
"motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"};

static std::atomic<bool> flipRectified{true};

int main(int argc, char** argv) {
using namespace std;
// Default blob path provided by Hunter private data download
Expand Down Expand Up @@ -107,32 +105,14 @@ int main(int argc, char** argv) {
cv::imshow(name, frame);
};

float disparityMultiplier = 255 / stereo->getMaxDisparity();
float disparityMultiplier = 255 / stereo->initialConfig.getMaxDisparity();

while(true) {
// Instead of get (blocking), we use tryGet (nonblocking) which will return the available data or None otherwise
auto inRight = qRight->tryGet<dai::ImgFrame>();
auto inDet = qDet->tryGet<dai::ImgDetections>();
auto inDisparity = qDisparity->tryGet<dai::ImgFrame>();

if(inRight) {
rightFrame = inRight->getCvFrame();
if(flipRectified) {
cv::flip(rightFrame, rightFrame, 1);
}
}

if(inDet) {
detections = inDet->detections;
if(flipRectified) {
for(auto& detection : detections) {
auto swap = detection.xmin;
detection.xmin = 1 - detection.xmax;
detection.xmax = 1 - swap;
}
}
}

if(inDisparity) {
// Frame is transformed, normalized, and color map will be applied to highlight the depth info
disparityFrame = inDisparity->getFrame();
Expand Down
2 changes: 1 addition & 1 deletion examples/src/rgb_depth_aligned.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ int main() {
if(latestPacket.find(name) != latestPacket.end()) {
if(name == "depth") {
frame[name] = latestPacket[name]->getFrame();
auto maxDisparity = stereo->getMaxDisparity();
auto maxDisparity = stereo->initialConfig.getMaxDisparity();
// Optional, extend range 0..95 -> 0..255, for a better visualisation
if(1) frame[name].convertTo(frame[name], CV_8UC1, 255. / maxDisparity);
// Optional, apply false colorization
Expand Down
9 changes: 1 addition & 8 deletions examples/src/rgb_encoding_mono_mobilenet_depth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ static const std::vector<std::string> labelMap = {"background", "aeroplane", "bi
"car", "cat", "chair", "cow", "diningtable", "dog", "horse",
"motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"};

static std::atomic<bool> flipRectified{true};

int main(int argc, char** argv) {
using namespace std;
// Default blob path provided by Hunter private data download
Expand Down Expand Up @@ -58,9 +56,7 @@ int main(int argc, char** argv) {
monoLeft->setResolution(dai::MonoCameraProperties::SensorResolution::THE_400_P);
videoEncoder->setDefaultProfilePreset(1920, 1080, 30, dai::VideoEncoderProperties::Profile::H265_MAIN);

// Note: the rectified streams are horizontally mirrored by default
depth->initialConfig.setConfidenceThreshold(255);
depth->setRectifyMirrorFrame(false);
depth->setRectifyEdgeFillColor(0); // Black, to better see the cutout

nn->setConfidenceThreshold(0.5);
Expand All @@ -85,7 +81,7 @@ int main(int argc, char** argv) {
nn->out.link(nnOut->input);

// Disparity range is used for normalization
float disparityMultiplier = 255 / depth->getMaxDisparity();
float disparityMultiplier = 255 / depth->initialConfig.getMaxDisparity();

// Connect to device and start pipeline
dai::Device device(pipeline);
Expand Down Expand Up @@ -128,9 +124,6 @@ int main(int argc, char** argv) {

if(inDisparity) {
frameDisparity = inDisparity->getCvFrame();
if(flipRectified) {
cv::flip(frameDisparity, frameDisparity, 1);
}
frameDisparity.convertTo(frameDisparity, CV_8UC1, disparityMultiplier);
cv::applyColorMap(frameDisparity, frameDisparity, cv::COLORMAP_JET);
}
Expand Down
7 changes: 0 additions & 7 deletions examples/src/spatial_mobilenet_mono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ static const std::vector<std::string> labelMap = {"background", "aeroplane", "bi
"motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"};

static std::atomic<bool> syncNN{true};
static std::atomic<bool> flipRectified{true};

int main(int argc, char** argv) {
using namespace std;
Expand Down Expand Up @@ -112,7 +111,6 @@ int main(int argc, char** argv) {
}

cv::Mat rectifiedRight = inRectified->getCvFrame();
if(flipRectified) cv::flip(rectifiedRight, rectifiedRight, 1);

cv::Mat depthFrame = inDepth->getFrame();
cv::Mat depthFrameColor;
Expand All @@ -139,11 +137,6 @@ int main(int argc, char** argv) {
}

for(auto& detection : detections) {
if(flipRectified) {
auto swap = detection.xmin;
detection.xmin = 1 - detection.xmax;
detection.xmax = 1 - swap;
}
int x1 = detection.xmin * rectifiedRight.cols;
int y1 = detection.ymin * rectifiedRight.rows;
int x2 = detection.xmax * rectifiedRight.cols;
Expand Down
12 changes: 4 additions & 8 deletions examples/src/stereo_depth_video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ int main() {

if(withDepth) {
// StereoDepth
stereo->initialConfig.setConfidenceThreshold(200);
stereo->initialConfig.setConfidenceThreshold(230);
stereo->setRectifyEdgeFillColor(0); // black, to better see the cutout
// stereo->loadCalibrationFile("../../../../depthai/resources/depthai.calib");
// stereo->setInputResolution(1280, 720);
// TODO: median filtering is disabled on device with (lrcheck || extended || subpixel)
stereo->initialConfig.setMedianFilter(dai::MedianFilter::MEDIAN_OFF);
stereo->initialConfig.setMedianFilter(dai::MedianFilter::KERNEL_5x5);
stereo->setLeftRightCheck(lrcheck);
stereo->setExtendedDisparity(extended);
stereo->setSubpixel(subpixel);
Expand Down Expand Up @@ -91,7 +89,7 @@ int main() {
auto rectifRightQueue = withDepth ? device.getOutputQueue("rectified_right", 8, false) : nullptr;

// Disparity range is used for normalization
float disparityMultiplier = withDepth ? 255 / stereo->getMaxDisparity() : 0;
float disparityMultiplier = withDepth ? 255 / stereo->initialConfig.getMaxDisparity() : 0;

while(true) {
auto left = leftQueue->get<dai::ImgFrame>();
Expand All @@ -111,16 +109,14 @@ int main() {

if(outputDepth) {
auto depth = depthQueue->get<dai::ImgFrame>();
cv::imshow("depth", cv::Mat(depth->getHeight(), depth->getWidth(), CV_16UC1, depth->getData().data()));
cv::imshow("depth", depth->getCvFrame());
}

if(outputRectified) {
auto rectifL = rectifLeftQueue->get<dai::ImgFrame>();
// cv::flip(rectifiedLeftFrame, rectifiedLeftFrame, 1);
cv::imshow("rectified_left", rectifL->getFrame());

auto rectifR = rectifRightQueue->get<dai::ImgFrame>();
// cv::flip(rectifiedRightFrame, rectifiedRightFrame, 1);
cv::imshow("rectified_right", rectifR->getFrame());
}
}
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.