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

Added some clarifications to depth docs #353

Merged
merged 1 commit into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion examples/SpatialDetection/spatial_location_calculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ int main() {
while(true) {
auto inDepth = depthQueue->get<dai::ImgFrame>();

cv::Mat depthFrame = inDepth->getFrame();
cv::Mat depthFrame = inDepth->getFrame(); // depthFrame values are in millimeters
cv::Mat depthFrameColor;

cv::normalize(depthFrame, depthFrameColor, 255, 0, cv::NORM_INF, CV_8UC1);
cv::equalizeHist(depthFrameColor, depthFrameColor);
cv::applyColorMap(depthFrameColor, depthFrameColor, cv::COLORMAP_HOT);
Expand Down
2 changes: 1 addition & 1 deletion examples/SpatialDetection/spatial_mobilenet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int main(int argc, char** argv) {
}

cv::Mat frame = inPreview->getCvFrame();
cv::Mat depthFrame = depth->getFrame();
cv::Mat depthFrame = depth->getFrame(); // depthFrame values are in millimeters

cv::Mat depthFrameColor;
cv::normalize(depthFrame, depthFrameColor, 255, 0, cv::NORM_INF, CV_8UC1);
Expand Down
3 changes: 2 additions & 1 deletion examples/SpatialDetection/spatial_mobilenet_mono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ int main(int argc, char** argv) {

cv::Mat rectifiedRight = inRectified->getCvFrame();

cv::Mat depthFrame = inDepth->getFrame();
cv::Mat depthFrame = inDepth->getFrame(); // depthFrame values are in millimeters
cv::Mat depthFrameColor;

cv::normalize(depthFrame, depthFrameColor, 255, 0, cv::NORM_INF, CV_8UC1);
cv::equalizeHist(depthFrameColor, depthFrameColor);
cv::applyColorMap(depthFrameColor, depthFrameColor, cv::COLORMAP_HOT);
Expand Down
3 changes: 2 additions & 1 deletion examples/SpatialDetection/spatial_tiny_yolo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ int main(int argc, char** argv) {
auto depth = depthQueue->get<dai::ImgFrame>();

cv::Mat frame = imgFrame->getCvFrame();
cv::Mat depthFrame = depth->getFrame();
cv::Mat depthFrame = depth->getFrame(); // depthFrame values are in millimeters

cv::Mat depthFrameColor;
cv::normalize(depthFrame, depthFrameColor, 255, 0, cv::NORM_INF, CV_8UC1);
cv::equalizeHist(depthFrameColor, depthFrameColor);
Expand Down
3 changes: 2 additions & 1 deletion examples/StereoDepth/depth_crop_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ int main() {

while(true) {
auto inDepth = q->get<dai::ImgFrame>();
cv::Mat depthFrame = inDepth->getFrame();
cv::Mat depthFrame = inDepth->getFrame(); // depthFrame values are in millimeters

// Frame is transformed, the color map will be applied to highlight the depth info
cv::Mat depthFrameColor;
cv::normalize(depthFrame, depthFrameColor, 255, 0, cv::NORM_INF, CV_8UC1);
Expand Down
4 changes: 2 additions & 2 deletions examples/StereoDepth/rgb_depth_aligned.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ static constexpr int fps = 30;
// The disparity is computed at this resolution, then upscaled to RGB resolution
static constexpr auto monoRes = dai::MonoCameraProperties::SensorResolution::THE_400_P;

static float rgbWeight = 0.6f;
static float depthWeight = 0.4f;
static float rgbWeight = 0.4f;
static float depthWeight = 0.6f;

static void updateBlendWeights(int percentRgb, void* ctx) {
rgbWeight = float(percentRgb) / 100.f;
Expand Down