Feature/colorize depth frame - #1909
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis change adds a shared OpenCV depth-colorization API, exposes it through Python, and replaces custom depth/disparity visualization code across C++ and Python examples with the shared utility. ChangesDepth Colorization Utility
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant DepthFrame
participant Example
participant colorizeDepthFrame
participant OpenCV
DepthFrame->>Example: deliver depth frame
Example->>colorizeDepthFrame: request colorized frame
colorizeDepthFrame->>OpenCV: normalize and apply colormap
OpenCV-->>colorizeDepthFrame: BGR output
colorizeDepthFrame-->>Example: return display frame
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@examples/cpp/NeuralAssistedStereo/neural_assisted_stereo.cpp`:
- Line 32: Update the NeuralAssistedStereo pipeline to create and output the
depth frame from neuralAssistedStereo->depth, then use that depth output instead
of neuralAssistedStereo->disparity in the colorizeDepthFrame call. Preserve the
existing 500.0f and 12000.0f bounds and display flow.
In `@examples/python/NeuralAssistedStereo/neural_assisted_stereo.py`:
- Around line 26-27: Update the display path around disparityQueue.get() to
consume frames from the neuralAssistedStereo.depth output queue instead, then
pass that depth-in-millimeters frame to colorizeDepthFrame while preserving the
existing 500–12000 range and Depth display.
In `@src/opencv/ColorizeDepthFrame.cpp`:
- Around line 12-22: Correct the valid-pixel collection in the bounds-building
loop anchored by nz and values: make the mask condition match the valid-pixel
count, so values.push_back(d[c]) includes valid depths rather than zero/invalid
ones. Preserve the existing reserve and iteration structure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 8087ccb1-1388-440d-8e3d-c1ea3c8683b2
📒 Files selected for processing (59)
CMakeLists.txtbindings/python/src/pipeline/datatype/ImgFrameBindings.cppexamples/cpp/AutoCalibration/auto_calibration_example.cppexamples/cpp/Depth/depth_rgb_align.cppexamples/cpp/Depth/unified_depth.cppexamples/cpp/DetectionNetwork/detection_network_remap.cppexamples/cpp/DynamicCalibration/calibration_dynamic.cppexamples/cpp/DynamicCalibration/calibration_integration.cppexamples/cpp/ImageAlign/depth_align.cppexamples/cpp/Misc/PipelineDebugging/get_pipeline_state.cppexamples/cpp/Misc/PipelineDebugging/node_pipeline_events.cppexamples/cpp/NeuralAssistedStereo/neural_assisted_stereo.cppexamples/cpp/NeuralDepth/neural_depth.cppexamples/cpp/NeuralDepth/neural_depth_align.cppexamples/cpp/NeuralDepth/neural_depth_minimal.cppexamples/cpp/ObjectTracker/object_tracker_remap.cppexamples/cpp/Remapping/point_remapping.cppexamples/cpp/SpatialDetectionNetwork/spatial_detection.cppexamples/cpp/SpatialLocationCalculator/spatial_location_calculator.cppexamples/cpp/SpatialLocationCalculator/spatial_segmentation.cppexamples/cpp/StereoDepth/depth_preview.cppexamples/cpp/StereoDepth/stereo.cppexamples/cpp/StereoDepth/stereo_depth_remap.cppexamples/cpp/ToF/tof_align.cppexamples/cpp/ToF/tof_all_queues.cppexamples/cpp/ToF/tof_minimal.cppexamples/cpp/Vpp/virtual_patern_projection.cppexamples/python/AutoCalibration/auto_calibration_example.pyexamples/python/Depth/depth_rgb_align.pyexamples/python/Depth/unified_depth.pyexamples/python/DetectionNetwork/detection_network_remap.pyexamples/python/DynamicCalibration/calibration_dynamic.pyexamples/python/DynamicCalibration/calibration_integration.pyexamples/python/DynamicCalibration/calibration_quality_dynamic.pyexamples/python/ImageAlign/depth_align.pyexamples/python/Misc/PipelineDebugging/get_pipeline_state.pyexamples/python/Misc/PipelineDebugging/node_pipeline_events.pyexamples/python/NeuralAssistedStereo/neural_assisted_stereo.pyexamples/python/NeuralDepth/neural_depth.pyexamples/python/NeuralDepth/neural_depth_align.pyexamples/python/NeuralDepth/neural_depth_minimal.pyexamples/python/ObjectTracker/object_tracker_remap.pyexamples/python/PointCloud/point_cloud_visualizer.pyexamples/python/Remapping/point_remapping.pyexamples/python/SpatialDetectionNetwork/spatial_detection.pyexamples/python/SpatialLocationCalculator/spatial_keypoints.pyexamples/python/SpatialLocationCalculator/spatial_location_calculator.pyexamples/python/SpatialLocationCalculator/spatial_segmentation.pyexamples/python/StereoDepth/stereo.pyexamples/python/StereoDepth/stereo_depth_from_host.pyexamples/python/StereoDepth/stereo_depth_remap.pyexamples/python/StereoDepth/stereo_runtime_calibration_update.pyexamples/python/ToF/tof_align.pyexamples/python/ToF/tof_all_queues.pyexamples/python/ToF/tof_minimal.pyexamples/python/Vpp/virtual_patern_projection.pyinclude/depthai/depthai.hppinclude/depthai/utility/ColorizeDepthFrame.hppsrc/opencv/ColorizeDepthFrame.cpp
📜 Review details
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-05-28T13:36:26.383Z
Learnt from: moratom
Repo: luxonis/depthai-core PR: 1812
File: examples/cpp/ImageManip/image_manip_remap.cpp:51-52
Timestamp: 2026-05-28T13:36:26.383Z
Learning: In depthai-core example code, do not set `ImageManip::Backend::GPU` unconditionally. The GPU backend is only available on RVC4 (not RVC2). Prefer leaving the backend as the default, or comment out the GPU backend selection and add a clear note explaining it is RVC4-only support (so the example won’t fail or mislead on RVC2).
Applied to files:
examples/cpp/ObjectTracker/object_tracker_remap.cppexamples/cpp/Vpp/virtual_patern_projection.cppexamples/cpp/Remapping/point_remapping.cppexamples/cpp/NeuralDepth/neural_depth_minimal.cppexamples/python/SpatialLocationCalculator/spatial_segmentation.pyexamples/cpp/Misc/PipelineDebugging/node_pipeline_events.cppexamples/python/Remapping/point_remapping.pyexamples/cpp/StereoDepth/stereo_depth_remap.cppexamples/cpp/SpatialLocationCalculator/spatial_location_calculator.cppexamples/python/SpatialLocationCalculator/spatial_location_calculator.pyexamples/python/StereoDepth/stereo_depth_remap.pyexamples/cpp/Misc/PipelineDebugging/get_pipeline_state.cppexamples/cpp/StereoDepth/stereo.cppexamples/python/SpatialLocationCalculator/spatial_keypoints.pyexamples/python/NeuralDepth/neural_depth_minimal.pyexamples/cpp/AutoCalibration/auto_calibration_example.cppexamples/python/PointCloud/point_cloud_visualizer.pyexamples/python/ToF/tof_all_queues.pyexamples/python/DynamicCalibration/calibration_integration.pyexamples/python/DynamicCalibration/calibration_quality_dynamic.pyexamples/cpp/DynamicCalibration/calibration_dynamic.cppexamples/python/ToF/tof_minimal.pyexamples/python/Depth/unified_depth.pyexamples/cpp/ToF/tof_all_queues.cppexamples/cpp/SpatialDetectionNetwork/spatial_detection.cppexamples/python/Misc/PipelineDebugging/get_pipeline_state.pyexamples/cpp/DynamicCalibration/calibration_integration.cppexamples/cpp/Depth/depth_rgb_align.cppexamples/cpp/ToF/tof_align.cppexamples/python/NeuralDepth/neural_depth.pyexamples/python/Misc/PipelineDebugging/node_pipeline_events.pyexamples/cpp/NeuralAssistedStereo/neural_assisted_stereo.cppexamples/python/DynamicCalibration/calibration_dynamic.pyexamples/python/NeuralAssistedStereo/neural_assisted_stereo.pyexamples/cpp/ToF/tof_minimal.cppexamples/cpp/NeuralDepth/neural_depth.cppexamples/cpp/ImageAlign/depth_align.cppexamples/cpp/Depth/unified_depth.cppexamples/cpp/DetectionNetwork/detection_network_remap.cppexamples/cpp/NeuralDepth/neural_depth_align.cppexamples/cpp/SpatialLocationCalculator/spatial_segmentation.cppexamples/python/NeuralDepth/neural_depth_align.pyexamples/python/StereoDepth/stereo.pyexamples/cpp/StereoDepth/depth_preview.cppexamples/python/ToF/tof_align.pyexamples/python/Vpp/virtual_patern_projection.pyexamples/python/ObjectTracker/object_tracker_remap.pyexamples/python/StereoDepth/stereo_runtime_calibration_update.pyexamples/python/DetectionNetwork/detection_network_remap.pyexamples/python/Depth/depth_rgb_align.pyexamples/python/ImageAlign/depth_align.pyexamples/python/StereoDepth/stereo_depth_from_host.pyexamples/python/SpatialDetectionNetwork/spatial_detection.pyexamples/python/AutoCalibration/auto_calibration_example.py
🪛 Cppcheck (2.21.0)
src/opencv/ColorizeDepthFrame.cpp
[error] 120-120: There is an unknown macro here somewhere. Configuration is required. If DEPTHAI_NLOHMANN_DEFINE_TYPE_INTRUSIVE is a macro then please configure it.
(unknownMacro)
🪛 Ruff (0.15.21)
examples/python/SpatialLocationCalculator/spatial_segmentation.py
[warning] 65-65: Boolean positional value in function call
(FBT003)
examples/python/Remapping/point_remapping.py
[warning] 117-117: Boolean positional value in function call
(FBT003)
examples/python/StereoDepth/stereo_depth_remap.py
[warning] 28-28: Boolean positional value in function call
(FBT003)
examples/python/SpatialLocationCalculator/spatial_keypoints.py
[warning] 102-102: Boolean positional value in function call
(FBT003)
examples/python/NeuralDepth/neural_depth_minimal.py
[warning] 24-24: Boolean positional value in function call
(FBT003)
examples/python/PointCloud/point_cloud_visualizer.py
[warning] 114-114: Boolean positional value in function call
(FBT003)
examples/python/DynamicCalibration/calibration_integration.py
[warning] 62-62: Boolean positional value in function call
(FBT003)
examples/python/DynamicCalibration/calibration_quality_dynamic.py
[warning] 60-60: Boolean positional value in function call
(FBT003)
examples/python/Misc/PipelineDebugging/get_pipeline_state.py
[warning] 29-29: Boolean positional value in function call
(FBT003)
examples/python/NeuralDepth/neural_depth.py
[warning] 56-56: Boolean positional value in function call
(FBT003)
examples/python/Misc/PipelineDebugging/node_pipeline_events.py
[warning] 31-31: Boolean positional value in function call
(FBT003)
examples/python/DynamicCalibration/calibration_dynamic.py
[warning] 66-66: Boolean positional value in function call
(FBT003)
examples/python/NeuralAssistedStereo/neural_assisted_stereo.py
[warning] 27-27: Boolean positional value in function call
(FBT003)
examples/python/StereoDepth/stereo.py
[warning] 28-28: Boolean positional value in function call
(FBT003)
examples/python/Vpp/virtual_patern_projection.py
[warning] 86-86: Boolean positional value in function call
(FBT003)
examples/python/StereoDepth/stereo_runtime_calibration_update.py
[warning] 39-39: Boolean positional value in function call
(FBT003)
examples/python/StereoDepth/stereo_depth_from_host.py
[warning] 1142-1142: Boolean positional value in function call
(FBT003)
examples/python/SpatialDetectionNetwork/spatial_detection.py
[warning] 39-39: Boolean positional value in function call
(FBT003)
examples/python/AutoCalibration/auto_calibration_example.py
[warning] 124-124: Boolean positional value in function call
(FBT003)
🔇 Additional comments (58)
include/depthai/depthai.hpp (1)
24-27: LGTM!include/depthai/utility/ColorizeDepthFrame.hpp (1)
1-59: LGTM!src/opencv/ColorizeDepthFrame.cpp (1)
97-118: LGTM!CMakeLists.txt (1)
468-468: LGTM!bindings/python/src/pipeline/datatype/ImgFrameBindings.cpp (1)
11-11: LGTM!Also applies to: 329-349
examples/cpp/AutoCalibration/auto_calibration_example.cpp (1)
132-132: LGTM!examples/cpp/Depth/depth_rgb_align.cpp (1)
137-137: LGTM!examples/cpp/Depth/unified_depth.cpp (1)
298-298: LGTM!examples/cpp/DetectionNetwork/detection_network_remap.cpp (1)
24-24: LGTM!Also applies to: 103-103
examples/cpp/DynamicCalibration/calibration_dynamic.cpp (1)
35-35: LGTM!Also applies to: 57-62
examples/cpp/NeuralDepth/neural_depth.cpp (1)
43-43: LGTM!Also applies to: 85-86
examples/cpp/NeuralDepth/neural_depth_minimal.cpp (1)
41-49: LGTM!examples/python/Depth/unified_depth.py (1)
183-183: LGTM!examples/python/SpatialLocationCalculator/spatial_segmentation.py (1)
65-65: LGTM!examples/python/ToF/tof_minimal.py (1)
35-35: LGTM!examples/cpp/DynamicCalibration/calibration_integration.cpp (1)
48-48: LGTM!Also applies to: 66-71
examples/cpp/ImageAlign/depth_align.cpp (1)
128-128: LGTM!examples/cpp/Misc/PipelineDebugging/get_pipeline_state.cpp (1)
25-30: LGTM!examples/cpp/NeuralDepth/neural_depth_align.cpp (1)
114-114: LGTM!examples/cpp/ObjectTracker/object_tracker_remap.cpp (1)
17-17: LGTM!Also applies to: 102-102
examples/cpp/Remapping/point_remapping.cpp (1)
182-182: LGTM!examples/cpp/SpatialLocationCalculator/spatial_segmentation.cpp (1)
132-132: LGTM!examples/cpp/StereoDepth/stereo.cpp (1)
34-40: LGTM!Also applies to: 52-52
examples/cpp/ToF/tof_align.cpp (1)
106-112: LGTM!examples/cpp/ToF/tof_minimal.cpp (1)
23-23: LGTM!examples/cpp/Vpp/virtual_patern_projection.cpp (1)
77-77: LGTM!examples/cpp/Misc/PipelineDebugging/node_pipeline_events.cpp (1)
25-32: LGTM!examples/cpp/StereoDepth/depth_preview.cpp (1)
38-53: LGTM!examples/python/DynamicCalibration/calibration_dynamic.py (1)
23-31: LGTM!Also applies to: 61-67
examples/python/Misc/PipelineDebugging/get_pipeline_state.py (1)
23-30: LGTM!examples/python/Misc/PipelineDebugging/node_pipeline_events.py (1)
23-32: LGTM!examples/python/NeuralDepth/neural_depth_minimal.py (1)
17-25: LGTM!examples/python/PointCloud/point_cloud_visualizer.py (1)
114-114: LGTM!examples/python/SpatialLocationCalculator/spatial_keypoints.py (1)
102-102: LGTM!examples/python/StereoDepth/stereo.py (1)
21-29: LGTM!examples/python/StereoDepth/stereo_runtime_calibration_update.py (1)
26-40: LGTM!examples/cpp/SpatialDetectionNetwork/spatial_detection.cpp (1)
47-55: LGTM!examples/cpp/SpatialLocationCalculator/spatial_location_calculator.cpp (1)
91-91: LGTM!examples/cpp/StereoDepth/stereo_depth_remap.cpp (1)
34-35: LGTM!Also applies to: 93-93
examples/python/AutoCalibration/auto_calibration_example.py (1)
124-124: LGTM!examples/python/DynamicCalibration/calibration_integration.py (1)
37-37: LGTM!Also applies to: 57-62, 93-93
examples/python/DynamicCalibration/calibration_quality_dynamic.py (1)
37-37: LGTM!Also applies to: 55-61
examples/python/SpatialDetectionNetwork/spatial_detection.py (1)
39-39: LGTM!examples/python/SpatialLocationCalculator/spatial_location_calculator.py (1)
62-62: LGTM!examples/python/StereoDepth/stereo_depth_remap.py (1)
27-28: LGTM!Also applies to: 61-61
examples/python/Vpp/virtual_patern_projection.py (1)
86-86: LGTM!examples/python/StereoDepth/stereo_depth_from_host.py (1)
1140-1142: 🎯 Functional CorrectnessNo change needed.
GRAYF16mapscv::Matfloat32 input throughconvertTo(CV_16FC1), andcolorizeDepthFrame(CV_32F)accepts FP16 depth input before converting it internally.> Likely an incorrect or invalid review comment.examples/cpp/ToF/tof_all_queues.cpp (2)
1-11: LGTM!
44-44: 🩺 Stability & AvailabilityNo change needed.
ImgFrame::getCvFrame()is documented to return a copiedcv::Mat, so the temporaryImgFramedoes not keepdisplayFramealive.> Likely an incorrect or invalid review comment.examples/python/Depth/depth_rgb_align.py (1)
2-3: LGTM!Also applies to: 56-57, 107-107
examples/python/DetectionNetwork/detection_network_remap.py (1)
5-6: LGTM!Also applies to: 28-38, 83-84
examples/python/ImageAlign/depth_align.py (1)
2-5: LGTM!Also applies to: 60-61, 108-108
examples/python/NeuralDepth/neural_depth.py (1)
20-21: LGTM!Also applies to: 28-29, 54-56
examples/python/NeuralDepth/neural_depth_align.py (1)
2-5: LGTM!Also applies to: 52-66, 100-100
examples/python/ObjectTracker/object_tracker_remap.py (1)
5-5: LGTM!Also applies to: 34-44
examples/python/Remapping/point_remapping.py (1)
117-117: LGTM!examples/python/ToF/tof_align.py (1)
14-18: LGTM!Also applies to: 94-94
examples/python/ToF/tof_all_queues.py (1)
11-14: LGTM!Also applies to: 60-60
9fe20da to
e08dd0a
Compare
Introduces dai::utility::colorizeDepthFrame C++ overloads (cv::Mat and ImgFrame) plus Python bindings, supporting min/max depth, colormap and log/linear scaling. Replaces inline cv2.applyColorMap / cv::applyColorMap calls in C++ and Python depth examples with the new helper.
e08dd0a to
fbfd800
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@examples/python/AutoCalibration/auto_calibration_example.py`:
- Line 124: Update the colorizeDepthFrame calls in
examples/python/AutoCalibration/auto_calibration_example.py:124-124,
examples/python/NeuralAssistedStereo/neural_assisted_stereo.py:27-27,
examples/python/NeuralDepth/neural_depth.py:56-56, and
examples/python/Vpp/virtual_patern_projection.py:86-86 to pass the existing
False value as the explicit keyword argument useLog=False.
In `@examples/python/DynamicCalibration/calibration_dynamic.py`:
- Line 66: Replace the fifth positional argument in each dai.colorizeDepthFrame
call with the named useLog=True argument to satisfy Ruff FBT003 and make the
scaling mode explicit. Apply this change at
examples/python/DynamicCalibration/calibration_dynamic.py:66-66,
examples/python/DynamicCalibration/calibration_integration.py:62-62,
examples/python/DynamicCalibration/calibration_quality_dynamic.py:60-60,
examples/python/Misc/PipelineDebugging/get_pipeline_state.py:29-29,
examples/python/Misc/PipelineDebugging/node_pipeline_events.py:31-31,
examples/python/NeuralDepth/neural_depth_minimal.py:24-24,
examples/python/StereoDepth/stereo.py:28-28, and
examples/python/StereoDepth/stereo_runtime_calibration_update.py:39-39.
In `@examples/python/PointCloud/point_cloud_visualizer.py`:
- Line 114: Replace the final positional False argument with the explicit
useLog=False keyword in dai.colorizeDepthFrame calls at
examples/python/PointCloud/point_cloud_visualizer.py:114-114,
examples/python/Remapping/point_remapping.py:117-117,
examples/python/SpatialDetectionNetwork/spatial_detection.py:39-39,
examples/python/SpatialLocationCalculator/spatial_keypoints.py:102-102,
examples/python/SpatialLocationCalculator/spatial_segmentation.py:65-65, and
examples/python/StereoDepth/stereo_depth_remap.py:28-28, preserving the existing
linear-scaling behavior.
In `@examples/python/SpatialLocationCalculator/spatial_location_calculator.py`:
- Line 62: Update the depth colorization call in the SpatialLocationCalculator
example to pass useLog=false explicitly, preserving the previous linear depth
mapping and matching the intended C++ behavior. Keep the existing depth frame
and range arguments unchanged.
In `@src/opencv/ColorizeDepthFrame.cpp`:
- Around line 48-49: Update the invalidMask construction in the depth
colorization flow to mark every non-finite or non-positive depth as invalid, not
only values equal to zero. Ensure this mask is used to exclude those pixels from
auto-ranging and log scaling, and preserve the resulting black output for
invalid pixels.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 8cf84b8a-524d-4a45-99da-aa61ee7adcbf
📒 Files selected for processing (59)
CMakeLists.txtbindings/python/src/pipeline/datatype/ImgFrameBindings.cppexamples/cpp/AutoCalibration/auto_calibration_example.cppexamples/cpp/Depth/depth_rgb_align.cppexamples/cpp/Depth/unified_depth.cppexamples/cpp/DetectionNetwork/detection_network_remap.cppexamples/cpp/DynamicCalibration/calibration_dynamic.cppexamples/cpp/DynamicCalibration/calibration_integration.cppexamples/cpp/ImageAlign/depth_align.cppexamples/cpp/Misc/PipelineDebugging/get_pipeline_state.cppexamples/cpp/Misc/PipelineDebugging/node_pipeline_events.cppexamples/cpp/NeuralAssistedStereo/neural_assisted_stereo.cppexamples/cpp/NeuralDepth/neural_depth.cppexamples/cpp/NeuralDepth/neural_depth_align.cppexamples/cpp/NeuralDepth/neural_depth_minimal.cppexamples/cpp/ObjectTracker/object_tracker_remap.cppexamples/cpp/Remapping/point_remapping.cppexamples/cpp/SpatialDetectionNetwork/spatial_detection.cppexamples/cpp/SpatialLocationCalculator/spatial_location_calculator.cppexamples/cpp/SpatialLocationCalculator/spatial_segmentation.cppexamples/cpp/StereoDepth/depth_preview.cppexamples/cpp/StereoDepth/stereo.cppexamples/cpp/StereoDepth/stereo_depth_remap.cppexamples/cpp/ToF/tof_align.cppexamples/cpp/ToF/tof_all_queues.cppexamples/cpp/ToF/tof_minimal.cppexamples/cpp/Vpp/virtual_patern_projection.cppexamples/python/AutoCalibration/auto_calibration_example.pyexamples/python/Depth/depth_rgb_align.pyexamples/python/Depth/unified_depth.pyexamples/python/DetectionNetwork/detection_network_remap.pyexamples/python/DynamicCalibration/calibration_dynamic.pyexamples/python/DynamicCalibration/calibration_integration.pyexamples/python/DynamicCalibration/calibration_quality_dynamic.pyexamples/python/ImageAlign/depth_align.pyexamples/python/Misc/PipelineDebugging/get_pipeline_state.pyexamples/python/Misc/PipelineDebugging/node_pipeline_events.pyexamples/python/NeuralAssistedStereo/neural_assisted_stereo.pyexamples/python/NeuralDepth/neural_depth.pyexamples/python/NeuralDepth/neural_depth_align.pyexamples/python/NeuralDepth/neural_depth_minimal.pyexamples/python/ObjectTracker/object_tracker_remap.pyexamples/python/PointCloud/point_cloud_visualizer.pyexamples/python/Remapping/point_remapping.pyexamples/python/SpatialDetectionNetwork/spatial_detection.pyexamples/python/SpatialLocationCalculator/spatial_keypoints.pyexamples/python/SpatialLocationCalculator/spatial_location_calculator.pyexamples/python/SpatialLocationCalculator/spatial_segmentation.pyexamples/python/StereoDepth/stereo.pyexamples/python/StereoDepth/stereo_depth_from_host.pyexamples/python/StereoDepth/stereo_depth_remap.pyexamples/python/StereoDepth/stereo_runtime_calibration_update.pyexamples/python/ToF/tof_align.pyexamples/python/ToF/tof_all_queues.pyexamples/python/ToF/tof_minimal.pyexamples/python/Vpp/virtual_patern_projection.pyinclude/depthai/depthai.hppinclude/depthai/utility/ColorizeDepthFrame.hppsrc/opencv/ColorizeDepthFrame.cpp
📜 Review details
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-05-28T13:36:26.383Z
Learnt from: moratom
Repo: luxonis/depthai-core PR: 1812
File: examples/cpp/ImageManip/image_manip_remap.cpp:51-52
Timestamp: 2026-05-28T13:36:26.383Z
Learning: In depthai-core example code, do not set `ImageManip::Backend::GPU` unconditionally. The GPU backend is only available on RVC4 (not RVC2). Prefer leaving the backend as the default, or comment out the GPU backend selection and add a clear note explaining it is RVC4-only support (so the example won’t fail or mislead on RVC2).
Applied to files:
examples/python/PointCloud/point_cloud_visualizer.pyexamples/cpp/Misc/PipelineDebugging/get_pipeline_state.cppexamples/cpp/SpatialLocationCalculator/spatial_location_calculator.cppexamples/cpp/NeuralDepth/neural_depth_minimal.cppexamples/cpp/ToF/tof_minimal.cppexamples/python/ToF/tof_minimal.pyexamples/cpp/Remapping/point_remapping.cppexamples/python/Remapping/point_remapping.pyexamples/cpp/Misc/PipelineDebugging/node_pipeline_events.cppexamples/cpp/NeuralAssistedStereo/neural_assisted_stereo.cppexamples/python/DynamicCalibration/calibration_quality_dynamic.pyexamples/cpp/StereoDepth/stereo_depth_remap.cppexamples/cpp/StereoDepth/stereo.cppexamples/cpp/ToF/tof_all_queues.cppexamples/python/Misc/PipelineDebugging/get_pipeline_state.pyexamples/cpp/StereoDepth/depth_preview.cppexamples/python/SpatialLocationCalculator/spatial_location_calculator.pyexamples/python/StereoDepth/stereo.pyexamples/python/ObjectTracker/object_tracker_remap.pyexamples/python/SpatialLocationCalculator/spatial_keypoints.pyexamples/cpp/DetectionNetwork/detection_network_remap.cppexamples/python/DynamicCalibration/calibration_dynamic.pyexamples/python/ToF/tof_all_queues.pyexamples/cpp/AutoCalibration/auto_calibration_example.cppexamples/cpp/NeuralDepth/neural_depth.cppexamples/python/StereoDepth/stereo_runtime_calibration_update.pyexamples/cpp/NeuralDepth/neural_depth_align.cppexamples/python/Depth/depth_rgb_align.pyexamples/python/SpatialDetectionNetwork/spatial_detection.pyexamples/python/StereoDepth/stereo_depth_remap.pyexamples/cpp/Vpp/virtual_patern_projection.cppexamples/python/NeuralDepth/neural_depth.pyexamples/cpp/SpatialDetectionNetwork/spatial_detection.cppexamples/cpp/ImageAlign/depth_align.cppexamples/python/NeuralDepth/neural_depth_minimal.pyexamples/python/StereoDepth/stereo_depth_from_host.pyexamples/python/NeuralDepth/neural_depth_align.pyexamples/cpp/Depth/unified_depth.cppexamples/cpp/Depth/depth_rgb_align.cppexamples/python/Misc/PipelineDebugging/node_pipeline_events.pyexamples/python/SpatialLocationCalculator/spatial_segmentation.pyexamples/python/DetectionNetwork/detection_network_remap.pyexamples/cpp/SpatialLocationCalculator/spatial_segmentation.cppexamples/cpp/DynamicCalibration/calibration_integration.cppexamples/cpp/ToF/tof_align.cppexamples/python/ImageAlign/depth_align.pyexamples/python/DynamicCalibration/calibration_integration.pyexamples/python/Vpp/virtual_patern_projection.pyexamples/python/NeuralAssistedStereo/neural_assisted_stereo.pyexamples/cpp/DynamicCalibration/calibration_dynamic.cppexamples/python/ToF/tof_align.pyexamples/python/Depth/unified_depth.pyexamples/cpp/ObjectTracker/object_tracker_remap.cppexamples/python/AutoCalibration/auto_calibration_example.py
🪛 Cppcheck (2.21.0)
examples/cpp/ToF/tof_minimal.cpp
[error] 18-18: There is an unknown macro here somewhere. Configuration is required. If DEPTHAI_NLOHMANN_DEFINE_TYPE_INTRUSIVE is a macro then please configure it.
(unknownMacro)
src/opencv/ColorizeDepthFrame.cpp
[error] 120-120: There is an unknown macro here somewhere. Configuration is required. If DEPTHAI_NLOHMANN_DEFINE_TYPE_INTRUSIVE is a macro then please configure it.
(unknownMacro)
examples/cpp/ToF/tof_align.cpp
[error] 18-18: There is an unknown macro here somewhere. Configuration is required. If DEPTHAI_NLOHMANN_DEFINE_TYPE_INTRUSIVE is a macro then please configure it.
(unknownMacro)
🪛 Ruff (0.15.21)
examples/python/PointCloud/point_cloud_visualizer.py
[warning] 114-114: Boolean positional value in function call
(FBT003)
examples/python/Remapping/point_remapping.py
[warning] 117-117: Boolean positional value in function call
(FBT003)
examples/python/DynamicCalibration/calibration_quality_dynamic.py
[warning] 60-60: Boolean positional value in function call
(FBT003)
examples/python/Misc/PipelineDebugging/get_pipeline_state.py
[warning] 29-29: Boolean positional value in function call
(FBT003)
examples/python/StereoDepth/stereo.py
[warning] 28-28: Boolean positional value in function call
(FBT003)
examples/python/SpatialLocationCalculator/spatial_keypoints.py
[warning] 102-102: Boolean positional value in function call
(FBT003)
examples/python/DynamicCalibration/calibration_dynamic.py
[warning] 66-66: Boolean positional value in function call
(FBT003)
examples/python/StereoDepth/stereo_runtime_calibration_update.py
[warning] 39-39: Boolean positional value in function call
(FBT003)
examples/python/SpatialDetectionNetwork/spatial_detection.py
[warning] 39-39: Boolean positional value in function call
(FBT003)
examples/python/StereoDepth/stereo_depth_remap.py
[warning] 28-28: Boolean positional value in function call
(FBT003)
examples/python/NeuralDepth/neural_depth.py
[warning] 56-56: Boolean positional value in function call
(FBT003)
examples/python/NeuralDepth/neural_depth_minimal.py
[warning] 24-24: Boolean positional value in function call
(FBT003)
examples/python/StereoDepth/stereo_depth_from_host.py
[warning] 1142-1142: Boolean positional value in function call
(FBT003)
examples/python/Misc/PipelineDebugging/node_pipeline_events.py
[warning] 31-31: Boolean positional value in function call
(FBT003)
examples/python/SpatialLocationCalculator/spatial_segmentation.py
[warning] 65-65: Boolean positional value in function call
(FBT003)
examples/python/DynamicCalibration/calibration_integration.py
[warning] 62-62: Boolean positional value in function call
(FBT003)
examples/python/Vpp/virtual_patern_projection.py
[warning] 86-86: Boolean positional value in function call
(FBT003)
examples/python/NeuralAssistedStereo/neural_assisted_stereo.py
[warning] 27-27: Boolean positional value in function call
(FBT003)
examples/python/AutoCalibration/auto_calibration_example.py
[warning] 124-124: Boolean positional value in function call
(FBT003)
🔇 Additional comments (48)
include/depthai/utility/ColorizeDepthFrame.hpp (1)
1-53: LGTM!src/opencv/ColorizeDepthFrame.cpp (1)
1-47: LGTM!Also applies to: 50-122
include/depthai/depthai.hpp (1)
24-28: LGTM!CMakeLists.txt (1)
468-468: LGTM!bindings/python/src/pipeline/datatype/ImgFrameBindings.cpp (1)
11-11: LGTM!Also applies to: 329-350
examples/python/Depth/depth_rgb_align.py (1)
107-107: LGTM!examples/python/Depth/unified_depth.py (1)
183-183: LGTM!examples/python/DetectionNetwork/detection_network_remap.py (1)
28-38: LGTM!examples/python/ImageAlign/depth_align.py (1)
108-108: LGTM!examples/python/ObjectTracker/object_tracker_remap.py (1)
34-44: LGTM!examples/python/DynamicCalibration/calibration_dynamic.py (1)
23-31: LGTM!Also applies to: 61-65
examples/python/DynamicCalibration/calibration_integration.py (1)
37-37: LGTM!Also applies to: 57-61, 93-93
examples/python/DynamicCalibration/calibration_quality_dynamic.py (1)
37-37: LGTM!Also applies to: 55-59, 61-61
examples/python/Misc/PipelineDebugging/get_pipeline_state.py (1)
23-28: LGTM!Also applies to: 30-30
examples/python/Misc/PipelineDebugging/node_pipeline_events.py (1)
23-30: LGTM!Also applies to: 32-32
examples/python/NeuralDepth/neural_depth_align.py (1)
100-100: LGTM!examples/python/NeuralDepth/neural_depth_minimal.py (1)
17-23: LGTM!Also applies to: 25-25
examples/python/StereoDepth/stereo.py (1)
21-27: LGTM!Also applies to: 29-29
examples/python/StereoDepth/stereo_runtime_calibration_update.py (1)
26-38: LGTM!Also applies to: 40-40
examples/python/StereoDepth/stereo_depth_from_host.py (1)
1140-1142: 🎯 Functional CorrectnessNo change needed for
setCvFrame()onGRAYF16.
setCvFrame()converts the input OpenCV/NumPy data to the declared type, so passingfloat32data withdai.ImgFrame.Type.GRAYF16is supported.examples/python/ToF/tof_align.py (1)
5-15: LGTM!Also applies to: 21-24, 96-96
examples/python/ToF/tof_all_queues.py (1)
13-17: LGTM!Also applies to: 59-59
examples/python/ToF/tof_minimal.py (1)
13-15: LGTM!Also applies to: 36-36
examples/cpp/AutoCalibration/auto_calibration_example.cpp (1)
132-132: LGTM!examples/cpp/Depth/depth_rgb_align.cpp (1)
137-137: LGTM!examples/cpp/Misc/PipelineDebugging/node_pipeline_events.cpp (1)
25-32: LGTM!examples/cpp/NeuralDepth/neural_depth.cpp (1)
43-43: LGTM!Also applies to: 85-86
examples/cpp/Remapping/point_remapping.cpp (1)
182-182: LGTM!examples/cpp/SpatialDetectionNetwork/spatial_detection.cpp (1)
47-55: LGTM!examples/cpp/SpatialLocationCalculator/spatial_location_calculator.cpp (1)
91-91: LGTM!examples/cpp/SpatialLocationCalculator/spatial_segmentation.cpp (1)
132-132: LGTM!examples/cpp/StereoDepth/stereo_depth_remap.cpp (1)
34-35: LGTM!Also applies to: 93-93
examples/cpp/Depth/unified_depth.cpp (1)
298-298: LGTM!examples/cpp/ImageAlign/depth_align.cpp (1)
128-128: LGTM!examples/cpp/Misc/PipelineDebugging/get_pipeline_state.cpp (1)
25-30: LGTM!examples/cpp/NeuralAssistedStereo/neural_assisted_stereo.cpp (1)
27-32: LGTM! The previously flagged disparity/depth mismatch is resolved — the output now correctly comes fromneuralAssistedStereo->depth.examples/cpp/ToF/tof_align.cpp (1)
73-96: LGTM!examples/cpp/ToF/tof_all_queues.cpp (1)
8-13: LGTM!Also applies to: 50-51
examples/cpp/ToF/tof_minimal.cpp (1)
5-22: LGTM!examples/cpp/Vpp/virtual_patern_projection.cpp (1)
77-77: LGTM!examples/cpp/DetectionNetwork/detection_network_remap.cpp (1)
24-24: LGTM!Also applies to: 103-103, 130-130
examples/cpp/DynamicCalibration/calibration_dynamic.cpp (1)
35-35: LGTM!Also applies to: 54-62
examples/cpp/DynamicCalibration/calibration_integration.cpp (1)
48-48: LGTM!Also applies to: 66-71
examples/cpp/NeuralDepth/neural_depth_align.cpp (1)
114-114: LGTM!examples/cpp/NeuralDepth/neural_depth_minimal.cpp (1)
41-49: LGTM!examples/cpp/ObjectTracker/object_tracker_remap.cpp (1)
17-17: LGTM!Also applies to: 102-102
examples/cpp/StereoDepth/depth_preview.cpp (1)
38-53: LGTM!examples/cpp/StereoDepth/stereo.cpp (1)
34-40: LGTM!Also applies to: 52-52
0b79ae6 to
eaace1f
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/opencv/ColorizeDepthFrame.cpp (2)
112-120: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winPreserve metadata in the fallback frame.
The success path copies input metadata, but the exception path returns an output without timestamps, sequence information, or transformations. Call
output.setMetadata(frame)before constructing the zero-filled fallback.Proposed fix
} catch(const std::exception&) { ImgFrame output; + output.setMetadata(frame); if(frame.getWidth() > 0 && frame.getHeight() > 0) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/opencv/ColorizeDepthFrame.cpp` around lines 112 - 120, Update the exception fallback in the ColorizeDepthFrame processing method to call output.setMetadata(frame) before constructing the zero-filled image data, preserving timestamps, sequence information, and transformations while leaving the existing size, type, and return behavior unchanged.
55-83: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winValidate explicit depth bounds before scaling.
The
maxDepth <= minDepthcheck does not catch NaN values, and negativeminDepthvalues makestd::log(minDepth + EPS)undefined/NaN when logarithmic scaling is enabled. Validate finite bounds before the auto-range fallback, and require non-negative bounds before logarithmic scaling.Proposed validation
cv::Mat depth32f; frame.convertTo(depth32f, CV_32F); + if(!std::isfinite(minDepth) || !std::isfinite(maxDepth)) { + return cv::Mat::zeros(frame.size(), CV_8UC3); + } + if(maxDepth <= minDepth) { const auto range = computeAutoDepthRange(depth32f, invalidMask); minDepth = range.first; maxDepth = range.second; @@ cv::Mat scaled; if(useLog) { + if(minDepth < 0.0f || maxDepth <= 0.0f) { + return cv::Mat::zeros(frame.size(), CV_8UC3); + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/opencv/ColorizeDepthFrame.cpp` around lines 55 - 83, Update the depth-bound validation in the colorization flow before auto-range fallback to reject non-finite minDepth or maxDepth values, while retaining the existing ordering check. Before the useLog branch computes logarithms, require both bounds to be non-negative and return the existing zero image for invalid bounds; preserve normal scaling for valid finite ranges.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/opencv/ColorizeDepthFrame.cpp`:
- Around line 112-120: Update the exception fallback in the ColorizeDepthFrame
processing method to call output.setMetadata(frame) before constructing the
zero-filled image data, preserving timestamps, sequence information, and
transformations while leaving the existing size, type, and return behavior
unchanged.
- Around line 55-83: Update the depth-bound validation in the colorization flow
before auto-range fallback to reject non-finite minDepth or maxDepth values,
while retaining the existing ordering check. Before the useLog branch computes
logarithms, require both bounds to be non-negative and return the existing zero
image for invalid bounds; preserve normal scaling for valid finite ranges.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 304ad483-5294-4363-a9b6-a0e30743f894
📒 Files selected for processing (12)
examples/cpp/NeuralDepth/neural_depth.cppexamples/cpp/StereoDepth/stereo_depth_remap.cppexamples/python/DynamicCalibration/calibration_dynamic.pyexamples/python/DynamicCalibration/calibration_integration.pyexamples/python/DynamicCalibration/calibration_quality_dynamic.pyexamples/python/Misc/PipelineDebugging/get_pipeline_state.pyexamples/python/Misc/PipelineDebugging/node_pipeline_events.pyexamples/python/NeuralAssistedStereo/neural_assisted_stereo.pyexamples/python/NeuralDepth/neural_depth_minimal.pyexamples/python/StereoDepth/stereo.pyexamples/python/StereoDepth/stereo_runtime_calibration_update.pysrc/opencv/ColorizeDepthFrame.cpp
📜 Review details
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-05-28T13:36:26.383Z
Learnt from: moratom
Repo: luxonis/depthai-core PR: 1812
File: examples/cpp/ImageManip/image_manip_remap.cpp:51-52
Timestamp: 2026-05-28T13:36:26.383Z
Learning: In depthai-core example code, do not set `ImageManip::Backend::GPU` unconditionally. The GPU backend is only available on RVC4 (not RVC2). Prefer leaving the backend as the default, or comment out the GPU backend selection and add a clear note explaining it is RVC4-only support (so the example won’t fail or mislead on RVC2).
Applied to files:
examples/python/DynamicCalibration/calibration_quality_dynamic.pyexamples/python/NeuralAssistedStereo/neural_assisted_stereo.pyexamples/python/DynamicCalibration/calibration_integration.pyexamples/python/DynamicCalibration/calibration_dynamic.pyexamples/cpp/StereoDepth/stereo_depth_remap.cppexamples/cpp/NeuralDepth/neural_depth.cppexamples/python/Misc/PipelineDebugging/get_pipeline_state.pyexamples/python/NeuralDepth/neural_depth_minimal.pyexamples/python/StereoDepth/stereo.pyexamples/python/Misc/PipelineDebugging/node_pipeline_events.pyexamples/python/StereoDepth/stereo_runtime_calibration_update.py
🪛 Ruff (0.15.21)
examples/python/NeuralAssistedStereo/neural_assisted_stereo.py
[warning] 27-27: Boolean positional value in function call
(FBT003)
🔇 Additional comments (15)
src/opencv/ColorizeDepthFrame.cpp (3)
5-5: LGTM!Also applies to: 11-54
86-99: LGTM!Also applies to: 101-111
124-125: LGTM!examples/cpp/NeuralDepth/neural_depth.cpp (1)
43-43: LGTM!Also applies to: 52-52, 85-86
examples/cpp/StereoDepth/stereo_depth_remap.cpp (1)
34-35: LGTM!Also applies to: 93-93, 127-127
examples/python/NeuralAssistedStereo/neural_assisted_stereo.py (2)
27-27: Use the nameduseLogargument.The positional
Falsetriggers Ruff FBT003 and obscures the scaling mode. This repeats the existing finding; change it touseLog=False.🧰 Proposed fix
- cv.imshow("Depth", dai.colorizeDepthFrame(depth, 500, 12000, cv.COLORMAP_TURBO, False).getCvFrame()) + cv.imshow("Depth", dai.colorizeDepthFrame(depth, 500, 12000, cv.COLORMAP_TURBO, useLog=False).getCvFrame())Source: Linters/SAST tools
21-26: LGTM!examples/python/DynamicCalibration/calibration_dynamic.py (1)
66-66: LGTM!examples/python/DynamicCalibration/calibration_integration.py (1)
62-62: LGTM!examples/python/DynamicCalibration/calibration_quality_dynamic.py (1)
60-60: LGTM!examples/python/Misc/PipelineDebugging/get_pipeline_state.py (1)
29-29: LGTM!examples/python/Misc/PipelineDebugging/node_pipeline_events.py (1)
31-31: LGTM!examples/python/NeuralDepth/neural_depth_minimal.py (1)
24-24: LGTM!examples/python/StereoDepth/stereo.py (1)
28-28: LGTM!examples/python/StereoDepth/stereo_runtime_calibration_update.py (1)
39-39: LGTM!
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/opencv/ColorizeDepthFrame.cpp (1)
65-81: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winReject invalid depth bounds before logarithmic scaling.
With
useLog=True, a negative or non-finiteminDepth/maxDepthmakesstd::log(...)return NaN. Since NaN comparisons do not trigger thelogMaxDepth <= logMinDepthguard, valid pixels can be scaled as NaN and produce misleading output.Validate finite, non-negative bounds after auto-ranging and before calculating logarithms.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/opencv/ColorizeDepthFrame.cpp` around lines 65 - 81, In the useLog branch of the depth-colorization flow, validate the auto-ranged minDepth and maxDepth before computing logMinDepth/logMaxDepth: both must be finite and non-negative. For invalid bounds, return the existing zero-valued output, then retain the current logarithmic scaling and ordering guard for valid bounds.examples/python/StereoDepth/stereo_runtime_calibration_update.py (1)
58-58: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winDo not silently swallow calibration readback failures.
except: passhides whether calibration retrieval or coefficient access failed, making the interactive update appear successful when it was not. Catch the expected exception type and print or log the failure.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/python/StereoDepth/stereo_runtime_calibration_update.py` at line 58, Update the exception handling around the calibration readback in the interactive update flow: replace the bare except/pass with the expected exception type and print or log the failure details. Preserve successful calibration retrieval and coefficient access behavior while ensuring failures are visible.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@bindings/python/src/pipeline/datatype/ImgFrameBindings.cpp`:
- Around line 348-349: Update the docstring for the depth-frame colorization
binding to describe auto-range computation from finite positive pixels instead
of “non-zero” pixels. Modify only the documentation string near the
maxDepth/minDepth behavior and preserve the existing implementation.
---
Outside diff comments:
In `@examples/python/StereoDepth/stereo_runtime_calibration_update.py`:
- Line 58: Update the exception handling around the calibration readback in the
interactive update flow: replace the bare except/pass with the expected
exception type and print or log the failure details. Preserve successful
calibration retrieval and coefficient access behavior while ensuring failures
are visible.
In `@src/opencv/ColorizeDepthFrame.cpp`:
- Around line 65-81: In the useLog branch of the depth-colorization flow,
validate the auto-ranged minDepth and maxDepth before computing
logMinDepth/logMaxDepth: both must be finite and non-negative. For invalid
bounds, return the existing zero-valued output, then retain the current
logarithmic scaling and ordering guard for valid bounds.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0344d0be-6519-4e5a-939b-ae526dd1642f
📒 Files selected for processing (51)
bindings/python/src/pipeline/datatype/ImgFrameBindings.cppexamples/cpp/Depth/depth_rgb_align.cppexamples/cpp/Depth/unified_depth.cppexamples/cpp/DetectionNetwork/detection_network_remap.cppexamples/cpp/DynamicCalibration/calibration_dynamic.cppexamples/cpp/DynamicCalibration/calibration_integration.cppexamples/cpp/ImageAlign/depth_align.cppexamples/cpp/Misc/PipelineDebugging/get_pipeline_state.cppexamples/cpp/Misc/PipelineDebugging/node_pipeline_events.cppexamples/cpp/NeuralDepth/neural_depth.cppexamples/cpp/NeuralDepth/neural_depth_align.cppexamples/cpp/NeuralDepth/neural_depth_minimal.cppexamples/cpp/ObjectTracker/object_tracker_remap.cppexamples/cpp/SpatialLocationCalculator/spatial_location_calculator.cppexamples/cpp/StereoDepth/depth_preview.cppexamples/cpp/StereoDepth/stereo.cppexamples/cpp/StereoDepth/stereo_depth_remap.cppexamples/cpp/ToF/tof_align.cppexamples/cpp/ToF/tof_all_queues.cppexamples/cpp/ToF/tof_minimal.cppexamples/python/AutoCalibration/auto_calibration_example.pyexamples/python/Depth/depth_rgb_align.pyexamples/python/Depth/unified_depth.pyexamples/python/DetectionNetwork/detection_network_remap.pyexamples/python/DynamicCalibration/calibration_dynamic.pyexamples/python/DynamicCalibration/calibration_integration.pyexamples/python/DynamicCalibration/calibration_quality_dynamic.pyexamples/python/ImageAlign/depth_align.pyexamples/python/Misc/PipelineDebugging/get_pipeline_state.pyexamples/python/Misc/PipelineDebugging/node_pipeline_events.pyexamples/python/NeuralAssistedStereo/neural_assisted_stereo.pyexamples/python/NeuralDepth/neural_depth.pyexamples/python/NeuralDepth/neural_depth_align.pyexamples/python/NeuralDepth/neural_depth_minimal.pyexamples/python/ObjectTracker/object_tracker_remap.pyexamples/python/PointCloud/point_cloud_visualizer.pyexamples/python/Remapping/point_remapping.pyexamples/python/SpatialDetectionNetwork/spatial_detection.pyexamples/python/SpatialLocationCalculator/spatial_keypoints.pyexamples/python/SpatialLocationCalculator/spatial_location_calculator.pyexamples/python/SpatialLocationCalculator/spatial_segmentation.pyexamples/python/StereoDepth/stereo.pyexamples/python/StereoDepth/stereo_depth_from_host.pyexamples/python/StereoDepth/stereo_depth_remap.pyexamples/python/StereoDepth/stereo_runtime_calibration_update.pyexamples/python/ToF/tof_align.pyexamples/python/ToF/tof_all_queues.pyexamples/python/ToF/tof_minimal.pyexamples/python/Vpp/virtual_patern_projection.pyinclude/depthai/utility/ColorizeDepthFrame.hppsrc/opencv/ColorizeDepthFrame.cpp
📜 Review details
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-05-28T13:36:26.383Z
Learnt from: moratom
Repo: luxonis/depthai-core PR: 1812
File: examples/cpp/ImageManip/image_manip_remap.cpp:51-52
Timestamp: 2026-05-28T13:36:26.383Z
Learning: In depthai-core example code, do not set `ImageManip::Backend::GPU` unconditionally. The GPU backend is only available on RVC4 (not RVC2). Prefer leaving the backend as the default, or comment out the GPU backend selection and add a clear note explaining it is RVC4-only support (so the example won’t fail or mislead on RVC2).
Applied to files:
examples/cpp/Misc/PipelineDebugging/get_pipeline_state.cppexamples/cpp/Misc/PipelineDebugging/node_pipeline_events.cppexamples/cpp/SpatialLocationCalculator/spatial_location_calculator.cppexamples/python/ToF/tof_minimal.pyexamples/cpp/NeuralDepth/neural_depth_minimal.cppexamples/cpp/ToF/tof_minimal.cppexamples/cpp/StereoDepth/stereo.cppexamples/python/PointCloud/point_cloud_visualizer.pyexamples/python/Remapping/point_remapping.pyexamples/cpp/ImageAlign/depth_align.cppexamples/python/DynamicCalibration/calibration_quality_dynamic.pyexamples/cpp/NeuralDepth/neural_depth_align.cppexamples/cpp/ToF/tof_align.cppexamples/python/SpatialLocationCalculator/spatial_location_calculator.pyexamples/cpp/Depth/unified_depth.cppexamples/python/DynamicCalibration/calibration_dynamic.pyexamples/python/ToF/tof_all_queues.pyexamples/python/SpatialLocationCalculator/spatial_keypoints.pyexamples/cpp/ToF/tof_all_queues.cppexamples/python/StereoDepth/stereo_depth_remap.pyexamples/python/Vpp/virtual_patern_projection.pyexamples/python/Depth/depth_rgb_align.pyexamples/python/StereoDepth/stereo.pyexamples/python/StereoDepth/stereo_depth_from_host.pyexamples/python/ImageAlign/depth_align.pyexamples/python/Depth/unified_depth.pyexamples/python/AutoCalibration/auto_calibration_example.pyexamples/python/Misc/PipelineDebugging/get_pipeline_state.pyexamples/cpp/NeuralDepth/neural_depth.cppexamples/cpp/ObjectTracker/object_tracker_remap.cppexamples/python/NeuralDepth/neural_depth_minimal.pyexamples/python/ToF/tof_align.pyexamples/cpp/StereoDepth/depth_preview.cppexamples/python/NeuralAssistedStereo/neural_assisted_stereo.pyexamples/python/NeuralDepth/neural_depth_align.pyexamples/cpp/StereoDepth/stereo_depth_remap.cppexamples/cpp/DynamicCalibration/calibration_dynamic.cppexamples/python/SpatialDetectionNetwork/spatial_detection.pyexamples/cpp/DetectionNetwork/detection_network_remap.cppexamples/python/Misc/PipelineDebugging/node_pipeline_events.pyexamples/python/DetectionNetwork/detection_network_remap.pyexamples/cpp/Depth/depth_rgb_align.cppexamples/python/StereoDepth/stereo_runtime_calibration_update.pyexamples/python/DynamicCalibration/calibration_integration.pyexamples/python/NeuralDepth/neural_depth.pyexamples/python/ObjectTracker/object_tracker_remap.pyexamples/cpp/DynamicCalibration/calibration_integration.cppexamples/python/SpatialLocationCalculator/spatial_segmentation.py
🔇 Additional comments (51)
examples/cpp/Depth/depth_rgb_align.cpp (1)
68-69: LGTM!Also applies to: 137-137
examples/cpp/Depth/unified_depth.cpp (1)
32-32: LGTM!Also applies to: 298-298
examples/cpp/DetectionNetwork/detection_network_remap.cpp (1)
1-14: LGTM!Also applies to: 24-24, 103-103, 130-130
examples/cpp/DynamicCalibration/calibration_dynamic.cpp (1)
2-2: LGTM!Also applies to: 35-35, 54-62
examples/cpp/ObjectTracker/object_tracker_remap.cpp (1)
1-8: LGTM!Also applies to: 17-17, 102-102
examples/cpp/StereoDepth/depth_preview.cpp (1)
38-53: LGTM!examples/cpp/StereoDepth/stereo_depth_remap.cpp (1)
34-35: LGTM!Also applies to: 93-93, 127-127
examples/cpp/ToF/tof_align.cpp (1)
1-13: LGTM!Also applies to: 85-85
examples/cpp/ToF/tof_all_queues.cpp (1)
1-1: LGTM!Also applies to: 9-13, 51-51
examples/cpp/ToF/tof_minimal.cpp (1)
1-5: LGTM!Also applies to: 22-22
examples/cpp/DynamicCalibration/calibration_integration.cpp (1)
48-48: LGTM!Also applies to: 57-57, 66-71
examples/cpp/ImageAlign/depth_align.cpp (1)
46-47: LGTM!Also applies to: 128-128
examples/cpp/Misc/PipelineDebugging/get_pipeline_state.cpp (1)
25-30: LGTM!examples/cpp/Misc/PipelineDebugging/node_pipeline_events.cpp (1)
25-32: LGTM!examples/cpp/NeuralDepth/neural_depth.cpp (1)
43-43: LGTM!Also applies to: 51-51, 85-86
examples/cpp/NeuralDepth/neural_depth_align.cpp (1)
42-43: LGTM!Also applies to: 114-114
examples/cpp/NeuralDepth/neural_depth_minimal.cpp (1)
41-49: LGTM!examples/cpp/SpatialLocationCalculator/spatial_location_calculator.cpp (1)
91-91: LGTM!Also applies to: 198-198
examples/cpp/StereoDepth/stereo.cpp (1)
34-40: LGTM!Also applies to: 52-52
include/depthai/utility/ColorizeDepthFrame.hpp (1)
14-31: LGTM!Also applies to: 32-49
examples/python/AutoCalibration/auto_calibration_example.py (1)
4-5: LGTM!Also applies to: 124-124
examples/python/Depth/depth_rgb_align.py (1)
2-3: LGTM!Also applies to: 56-58, 107-107
examples/python/DetectionNetwork/detection_network_remap.py (1)
4-5: LGTM!Also applies to: 28-38, 81-83
examples/python/DynamicCalibration/calibration_dynamic.py (1)
23-31: LGTM!Also applies to: 42-42, 61-67
examples/python/DynamicCalibration/calibration_integration.py (1)
37-37: LGTM!Also applies to: 49-49, 57-62, 93-93
examples/python/NeuralDepth/neural_depth_align.py (1)
2-2: LGTM!Also applies to: 52-55, 100-100, 124-124
examples/python/NeuralDepth/neural_depth_minimal.py (1)
4-5: LGTM!Also applies to: 17-25
examples/python/SpatialLocationCalculator/spatial_segmentation.py (1)
65-65: LGTM!examples/python/StereoDepth/stereo_depth_from_host.py (1)
1127-1128: LGTM!Also applies to: 1140-1142
src/opencv/ColorizeDepthFrame.cpp (1)
5-5: LGTM!Also applies to: 11-64, 82-99, 101-122
bindings/python/src/pipeline/datatype/ImgFrameBindings.cpp (1)
11-11: LGTM!Also applies to: 328-347
examples/python/Depth/unified_depth.py (1)
36-45: LGTM!Also applies to: 183-183
examples/python/DynamicCalibration/calibration_quality_dynamic.py (1)
37-37: LGTM!Also applies to: 49-61
examples/python/ImageAlign/depth_align.py (1)
2-3: LGTM!Also applies to: 60-62, 108-108
examples/python/NeuralDepth/neural_depth.py (1)
20-20: LGTM!Also applies to: 28-29, 54-56
examples/python/PointCloud/point_cloud_visualizer.py (1)
114-114: LGTM!examples/python/Remapping/point_remapping.py (1)
117-117: LGTM!examples/python/SpatialDetectionNetwork/spatial_detection.py (1)
6-7: LGTM!Also applies to: 33-39
examples/python/SpatialLocationCalculator/spatial_keypoints.py (1)
102-102: LGTM!examples/python/StereoDepth/stereo_depth_remap.py (1)
27-28: LGTM!Also applies to: 61-61
examples/python/Misc/PipelineDebugging/get_pipeline_state.py (1)
1-1: LGTM!Also applies to: 23-30
examples/python/Misc/PipelineDebugging/node_pipeline_events.py (1)
2-2: LGTM!Also applies to: 23-32
examples/python/NeuralAssistedStereo/neural_assisted_stereo.py (1)
1-5: LGTM!Also applies to: 21-27
examples/python/ObjectTracker/object_tracker_remap.py (1)
5-5: LGTM!Also applies to: 34-44
examples/python/SpatialLocationCalculator/spatial_location_calculator.py (1)
59-62: LGTM!examples/python/StereoDepth/stereo.py (1)
5-5: LGTM!Also applies to: 21-29
examples/python/StereoDepth/stereo_runtime_calibration_update.py (1)
26-57: LGTM!examples/python/ToF/tof_align.py (1)
14-14: LGTM!Also applies to: 21-24, 96-96
examples/python/ToF/tof_all_queues.py (1)
11-16: LGTM!Also applies to: 59-59
examples/python/ToF/tof_minimal.py (1)
11-15: LGTM!Also applies to: 36-36
examples/python/Vpp/virtual_patern_projection.py (1)
1-1: LGTM!Also applies to: 14-15, 86-86
859cbde to
ae3541b
Compare
MaticTonin
left a comment
There was a problem hiding this comment.
Please unify the API to be same for cpp and py since now its dai.::utility::... in CPP, in dai.colo... in python,
unify for dai.utility,colorize...
…amples also dont set default params
Why
colorizeDepthFramewhich unifies colorization of depth images.Usage
Summary by CodeRabbit
minDepth,maxDepth, colormap selection, and optional log scaling.colorizeDepthFrame, supporting DepthAI frames, with percentile auto-range whenmaxDepth <= minDepth.