Add device ID to image transformations - #1942
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📜 Recent review details🧰 Additional context used🧠 Learnings (2)📚 Learning: 2026-03-23T09:35:30.339ZApplied to files:
📚 Learning: 2026-03-24T22:39:04.364ZApplied to files:
🔇 Additional comments (8)
📝 WalkthroughWalkthrough
ChangesDevice identity for image transformations
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change adds and propagates device IDs for image transformations with compatibility handling and tests; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
aljazkonec1
left a comment
There was a problem hiding this comment.
Thanks, I'm struggling to understand the usefulness of having source device ID stored? This PR is then not meant for multi device support no?
| CameraModel distortionModel = CameraModel::Perspective; | ||
| std::vector<float> distortionCoefficients; | ||
| Extrinsics extrinsics = {}; | ||
| std::string deviceId; |
There was a problem hiding this comment.
In the context of multi device pipelines, how would deviceId be used? Looking at the current code, it throws any time the deviceId is different. Is there a reason you decided against deviceId meaning the target device? Is there a reason why we need source device ID at all?
| } | ||
| } | ||
|
|
||
| } // namespace |
There was a problem hiding this comment.
lets remove the codex generated anonymous namespace :)
| bool differentKnownDeviceIds(const ImgTransformation& lhs, const ImgTransformation& rhs) { | ||
| const auto& lhsDeviceId = lhs.getDeviceId(); |
There was a problem hiding this comment.
lhs and rhs arent general parameter names. From my understanding we will be using deviceId for multi-device cases so this naming really does not fit here
| } | ||
|
|
||
| dai::Point2f interSourceFrameTransform(dai::Point2f sourcePt, const ImgTransformation& from, const ImgTransformation& to) { | ||
| validateSameKnownDevice(from, to, "remap between"); |
There was a problem hiding this comment.
I would expand the function to also validate the toCameraSockets like it is done in the below lines. Also if deviceId means target device to where it is pointing to, then we should make it a member funciton of Extrnisics
Adds the source device ID to ImgTransformation.
The device ID is stored directly on the transformation instead of in Extrinsics, because extrinsics are part of per-camera EEPROM calibration data. Storing device-level information there would duplicate it for every camera.
This PR also:
Serializes and deserializes the device ID.
Exposes it through the C++ and Python APIs.
Propagates it through rectification.
Prevents remapping and alignment between transformations with different known device IDs.
Treats an empty device ID as unknown for compatibility with older replay datasets.
Adds tests for serialization, equality, alignment, remapping, and replay compatibility.
Summary by CodeRabbit
New Features
Bug Fixes