GetVideoStreamFrameBuffer with Undistorted gives a strange image in Vive Pro
Hello. I am testing GetVideoStreamFrameBuffer function in Vive Pro.
In VRTrackedCameraFrameType_Distorted, the function returns a vertical stereo image correctly.
However, the function returns a strange image if VRTrackedCameraFrameType_Undistorted is used.
The image shows only side of right camera, and top/bottom side has incorrect region.
This problem can be reproduced in tracked_camera_openvr_sample.
Is this internal bug? or did I misuse the function?
p.s. In original Vive, the function worked well in Undistorted and Distorted.
I'm also seeing problems with getting images from each of the cameras on a Vive Pro. Actually, there are quite a few problems.
When trying to get images as MaximumUndistorted, you need a bigger frame buffer than reported (I used double the frame buffer size) to get a valid return, otherwise you get an VRTrackedCameraError_SharedTextureFailure error. However, when you do this, the right eye data isn't right. It looks like it is split in half with the bottom half above the top. The left eye looks ok. The alpha also seems off.
When getting a Distorted image (the only one that returns reasonable images), but the alpha value is really erratic for the entire image. It almost seems to be A = 1- ((R + G +B)/3), but not quite, which really doesn't make sense.
When getting the head to camera matrix array for each of the cameras, the second camera has a position transform that looks like it's in millimeters:
(from visual studio debugger) ◢ | m | 0x000000302b755850 {0x000000302b755850 {0.999914646, 0.00493778614, -0.0120954532, -65.1875305}, 0x000000302b755860 {...}, ...} | float[3][4] | ▶ [0] | 0x000000302b755850 {0.999914646, 0.00493778614, -0.0120954532, -65.1875305} | float[4] | ▶ [1] | 0x000000302b755860 {0.00499709276, -0.999987662, 0.00487794541, 0.438318074} | float[4] | ▶ [2] | 0x000000302b755870 {-0.0120710721, -0.00493797101, -0.999926984, -0.242902413} | float[4]
Isn't everything supposed to be in meters?
The left eye transform is the identity matrix. Shouldn't the head location be between the eyes with offsets in each direction?
I would love an example of how to properly get the undistorted images from each camera with a proper pose and projection matrix for each camera.
the image darkness might be explained by SRGB values?
Thanks for your reports - this was broken by some aspects of dual-camera support after the initial release. It will be fixed in the upcoming beta release where Distorted frames will be 612x920 and there will be no difference in size or contents or bounds to Undistorted and MaximumUndistorted frames, which will be 1224x1840 (2x of Undistorted). The Undistorted texture will via the existing API contain some alpha=0 pixels. The reasoning behind this is that we need to update the call to get Undistorted bounds to offer two bounds for the inner sections of the MaximumUndistorted texture - the alternative would be to copy the inner sections of the MaximumUndistorted texture ( the region without alpha=0 sections ) to a new smaller 612x920 or so texture, and this was determined to significantly impact performance, rendering the camera data not useful.
forgot to note:
- the darkness of the image is corrected in the upcoming beta.
- I'm still looking into the problem with the second camera's position (extrinsics). it appears that there is an issue with some of the calibration data in some Vive Pro's and I am working with HTC to figure out what is happening with the factory calibration data. Stay tuned on this one, please.
Hi -- On Ubuntu (both 16.04 and 18.04) with a GTX1080 with nvidia driver 390 we are unable to check "Enable Camera" in the Steam VR Beta Settings (the Camera is listed as "Not Found"). We are able to Enable Camera only on regular Steam VR (not Beta), and also note that we are able to Enable Camera on Windows 10 with Steam VR (both Beta and not Beta). In sum, on Linux, if we want to enable the VivePro's cameras we are stuck with the regular Steam VR (not Beta) and, if I am reading this thread correctly, as a result we are only able to grab Distorted pixels, as noted in the original post. The Undistorted pixels only show one eye. My understanding is that for pass through to look correct to the eye, we need to be seeing the Undistorted texture. I'd like to confirm this -- is it the Undistorted texture that we are seeing in the Chaperone Overlay, for example? I should mention that the Chaperone Overlay does work for us on Linux.