Skip to content
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

a big bug in c2e #11

Closed
dlutwuwei opened this issue Nov 12, 2020 · 4 comments
Closed

a big bug in c2e #11

dlutwuwei opened this issue Nov 12, 2020 · 4 comments

Comments

@dlutwuwei
Copy link

dlutwuwei commented Nov 12, 2020

The list of equirectangulars generated by c2e is not right, look the picture:
Lark20201112-170458

the right, back and up picture is reversed, use an another tool, we got a right list pictures.

Lark20201112-170653

@Boscop
Copy link

Boscop commented Nov 28, 2020

@dlutwuwei Which tool would you recommend?

@lavalamp3774
Copy link

@Boscop You can use a simple numpy function to fix this, here's what I'm doing:

write_img('front', faces[0])
write_img('right', np.flip(faces[1], 1))
write_img('back', np.flip(faces[2], 1))
write_img('left', faces[3])
write_img('up', np.flip(faces[4], 0))
write_img('down', faces[5])

@zafirshi
Copy link

zafirshi commented Jul 6, 2022

Cause of the problem

I think the reason for this phenomenon is that the xyzcube function in the utils.py script has the wrong positive direction of the three surfaces R, B and U when generating each surface of the cube @Boscop @lavalamp3774

Explanation

The XYZ axis in the script is defined as follows: the horizontal right of the plane is the positive direction of the X axis, the vertical up is the positive direction of the Y axis, and the positive direction of the Z axis is pointed out perpendicular to the paper according to the right-hand rule

The grid variable is indexed according to the last dimension, which is small on the left, large on the right, small on the bottom and large on the top, that is, the orientation of the coordinate axis of the F surface is correct,

However, for R and B surfaces, the orientation of the coordinate axis should be larger on the left and smaller on the right (the vertical direction remains the same), and for U surfaces, the orientation of the coordinate axis should be larger on the bottom and smaller on the top (the horizontal direction remains the same)

This will cause the final result R, B to flip left and right, and U to flip up and down.

Fix it

The method to correct this error is very simple. Just flip the coordinate axis correctly in the three directions of R, B and U:
For example, for R surface (similar to B), it can be changed as follows in this position:

    grid_r = np.flip(grid, axis=1)                 
    out[:, 1 * face_w:2 * face_w, [2, 1]] = grid_r 

For U surface, changing in this position:

    grid_u = np.flip(grid, axis=0)                
    out[:, 4 * face_w:5 * face_w, [0, 2]] = grid_u

BrianPugh added a commit that referenced this issue Dec 16, 2024
e2c and c2e tests; fix flipped image issue mentioned in #11
@BrianPugh
Copy link
Collaborator

addressed in #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants