-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question image frame to image frame conversion. #25
Comments
UPDATE (Jan 9 2022): This issue has been resolved. See Hi! Great question. I'll dig into your question in more detail in a follow-up post, but one thing jumped out at me immediately. |
Thanks for looking into the issue. I fixed the typo -> meters to asset unit conversion factor -> meters from asset unit conversion factor. I am converting asset units into meters which is not even necessary if done consistently for both the camera poses and the world coordinates images, I think. |
Correct. Converting into meters is not necessary, and might introduce errors if you don't do it consistently. To keep things simple, I recommend performing your calculations in asset coordinates. That way, you can just use the raw values in
In your original question, I think you are inconsistently converting from asset units into meters, and this is leading to downstream problems. |
You are right, I had errors in question and I correct those. The final numbers are, however, still showing that something is wrong since I am still arriving at |
Out of curiosity, can you try your code on a different scene? What happens when you try your code on |
I am happy to share the code for ai_037_004. |
I don't need to see your code. Here is a silly test. Let's start with |
The code works for that test. I am getting the image space points that match world point indices. |
Ah, that's great. Let's stick with |
I was able to project points from frame |
A more comprehensive analysis of the projection: |
Now that your code is working for
In that thread, I recommended some steps that could help to make progress on this issue, but some of those steps require access to the native scene assets. However, you can still help us to make progress on this issue, even if you don't have access to the native scene assets. Can you compile a complete list of scenes that are affected? You could do this by repeating the test you've already done for every scene, i.e., project the world-space position at pixel coordinate x and verify that it projects to x. You're well-positioned to do this test because you already have working code for As I said in #24, I apologize for hijacking your thread with to-do items 😅 I wish I had more answers and fewer questions. But I figured this is the right place to document my incomplete understanding of the problem, and to highlight possible next steps. |
I saw that other thread and I was afraid that this could be the same issue. I only have a couple of datasets on disk and I can start the investigation and continue as I find the time to do so. Are you planning to correct the dataset once you know what is causing the issue. I am asking because I am not able to acquire the assets but I would still like to use the dataset in its entirety at some point in time. Working:
ai_001_002
ai_001_003
Not Working:
ai_015_001
ai_037_004
ai_041_009
ai_041_010
ai_052_002
|
Ah, thank you for posting that list. Please post here if you find other scenes that are affected. I think I know what the issue is (those shift and tilt parameters), and I believe it's worth finding a solution. The solution will probably involve exposing the shift and tilt parameters for each scene (e.g., similar to how we expose But I'm not sure exactly when I'll get to this. So, there is an opportunity for users of the dataset to help me narrow down the problem, because that will help me resolve it faster. |
We also came across this issue when we tried to compute frame-to-frame pixel correspondences in the Evermotion data set. We ran a unit test over all frames in the data set trying to find a correlation between frame-to-frame reprojection error and camera parameter shift. When trying to backproject all pixels
we'd expect We were able to correct at least |
Hi @Frank-Mic @rikba, I have some good news. I just checked in some data and example code that resolves this issue. In the contrib/mikeroberts3000 directory, I provide a modified perspective projection matrix for each scene that can be used as a drop-in replacement for the usual OpenGL perspective projection matrix, as well as example code for projecting world-space points into Hypersim images. I apologize that it took so long to address this issue. It was especially challenging to debug because V-Ray's behavior wasn't well-documented, and I've been busy with other projects and holiday travel. |
Hi,
I am trying to create pixel correspondences between two images of the same scene similar to Georgia in this issue #10. But I am having trouble getting accurate results.
I am going to use a reference pixel
(u = 8, v = 111)
in the image0002
for sceneai_037_004
to make it easier to compare the results.For this pixel position, I am getting a world coordinate of point_world_0002 =
[-213.125, 307.5, 239.125]
reading fromframe.0002.position.hdf5
.I want to find the corresponding image position in frame
0003
and doing the transformation from world to camera and projecting it into screen coordinates I am arriving at pixel position[u = 99, v = 170]
, which contains the world coordinate[-214.125, 320.75, 235.375]
substantially differing from point_world_0002. Checking image0003
(frame.0003.position.hdf5
) for world points being close to point_world_0002 I have found pixel location[u = 89, v= 155]
with a world coordinate[-213.125, 307., 239.125]
that is well aligned. Which is also verified to visually match in the color images.These are the steps I took arriving at
[u = 99, v = 170]
:Reading the camera_to_world pose for key frame
0003
and applying the conversion to meters I am getting this homogeneous matrix:and inverting it to get world_to_camera transformation yields the following transformation matrix:
I am getting the point in camera coordinates of key frame
0003
as follows:point_camera = world_to_camera * point_world
, resulting in the camera coordinate point_camera =[-261.46114373, 192.1710333 , -303.68105121]
.Following the code in this link
ml-hypersim/code/python/tools/scene_generate_images_bounding_box.py
Line 124 in 6a72764
I am using the parameters to project the
camera_point
into screen coordinates:resulting in point_clip =
[-367.89013141, 253.38057796, 456.41706849, 456.42794004]
and point_ndc =
[-0.80602018, 0.55513818, 0.99997618, 1.0]
leading to point_screen =
[ [ 99.22067678, 170.60450627, 0.99998809]]
and finally to point_image =
[99.22185845312404, 170.60653808660638]
.Any idea what I am missing or doing wrong.
The text was updated successfully, but these errors were encountered: