Fix: Poisoned python exception - #2
Merged
Merged
Conversation
moratom
approved these changes
Aug 14, 2026
Author
|
Tested and it works: |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
With PR #1909 a colorizeDepth frame was added to DepthAI. The function has two overloads:
utility.def( "colorizeDepthFrame", [](const cv::Mat& frame, float minDepth, float maxDepth, int colormap, bool useLog) ...and
utility.def( "colorizeDepthFrame", [](const ImgFrame& frame, float minDepth, float maxDepth, int colormap, bool useLog) ..When an
ImgFrameobject is passed, pybind probes thecv::Matoverload during dispatch. The customcv::Matcaster tries rejects the object, sets aTypeErrorbefore returning false. This PR clears the error before returning false. This allows pybind to probe the next overload and fail in the next overload if that one is not correct.Example of error:
error
Specification
None / not applicable
Dependencies & Potential Impact
None / not applicable
Deployment Plan
None / not applicable
Testing & Validation
None / not applicable
AI Usage
Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]
Submitted code was reviewed by a human: YES/NO
The author is taking the responsibility for the contribution: YES/NO