Comments (3)
@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])
from py360convert.
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
from py360convert.
@dlutwuwei Which tool would you recommend?
from py360convert.
Related Issues (15)
- What does each cubemap format means HOT 2
- Bug in c2e HOT 1
- python.exe: No module named convert360
- Add support for cube projecting with overlap
- Can we get a fisheye to equirectangular implementation?
- New PyPi Release HOT 1
- recommended reading materials HOT 1
- Problem with Py360Convert and Pillow HOT 1
- error in py360convert/utils.py line no: 193 HOT 2
- Support for p2e conversion
- Document is missing
- mapping between equirectangular and cubemap
- error in py360convert/utils.py line no: 217 HOT 2
- Numba Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py360convert.