You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we all know, OpenCV image origin [0,0] is the top, left corner of the image, +Y pointing down [1].
When retrieving HoloLens 2 PV camera frames using Media Foundation, the CameraIntrinsics.PrincipalPoint API documentation clearly states that "The origin [0,0] is the bottom, left corner of the image (+Y pointing up)" [2]. So the Y axis is reversed w.r.t. the OpenCV coordinate frame.
In the StreamRecorder sample [3], PrincipalPoint.y data is however passed as-is, whereas I was expecting CameraIntrinsics.ImageHeight() - PrincipalPoint.y. This has no effect in the context of the StreamRecorder sample, as the data are simply logged to a file. But a similar discrepancy can also be observed in the older HoloLensForCV repository sample when initializing cy component in the camera matrix later used for image undistortion [4].
What am I missing here? I've experimentally determined the HoloLens[2]ForCV samples being correct, i.e. taking PrincipalPoint.y as-is for OpenCV camera matrix cy component gives the correct visual result (with a sample app of my own), but I would also be very surprised that the CameraIntrinsics.PrincipalPoint API documentation could be so wrong, with a remark section even emphasizing the frame origin peculiarity from other image frameworks.
Hello,
As we all know, OpenCV image origin [0,0] is the top, left corner of the image, +Y pointing down [1].
When retrieving HoloLens 2 PV camera frames using Media Foundation, the CameraIntrinsics.PrincipalPoint API documentation clearly states that "The origin [0,0] is the bottom, left corner of the image (+Y pointing up)" [2]. So the Y axis is reversed w.r.t. the OpenCV coordinate frame.
In the StreamRecorder sample [3], PrincipalPoint.y data is however passed as-is, whereas I was expecting CameraIntrinsics.ImageHeight() - PrincipalPoint.y. This has no effect in the context of the StreamRecorder sample, as the data are simply logged to a file. But a similar discrepancy can also be observed in the older HoloLensForCV repository sample when initializing cy component in the camera matrix later used for image undistortion [4].
What am I missing here? I've experimentally determined the HoloLens[2]ForCV samples being correct, i.e. taking PrincipalPoint.y as-is for OpenCV camera matrix cy component gives the correct visual result (with a sample app of my own), but I would also be very surprised that the CameraIntrinsics.PrincipalPoint API documentation could be so wrong, with a remark section even emphasizing the frame origin peculiarity from other image frameworks.
Thanks for any input/suggestion/clarification.
[1] https://docs.opencv.org/4.0.1/d9/d0c/group__calib3d.html
[2] https://learn.microsoft.com/en-us/uwp/api/windows.media.devices.core.cameraintrinsics.principalpoint?view=winrt-17763#windows-media-devices-core-cameraintrinsics-principalpoint
[3]
HoloLens2ForCV/Samples/StreamRecorder/StreamRecorderApp/VideoFrameProcessor.cpp
Line 177 in 2072055
[4] https://github.com/microsoft/HoloLensForCV/blob/master/Samples/ComputeOnDevice/AppMain.cpp#L138
The text was updated successfully, but these errors were encountered: