Comments (3)
If you install opencv-python
, there is a more concise way, add the following lines after
spericalCoord = self._calcSphericaltoGnomonic(convertedScreenCoord)
sphericalCoord = sphericalCoord.reshape(self.height, self.width, 2).astype(np.float32) % 1
out = cv2.remap(frame,
sphericalCoord[..., 0]*self.frame_width,
sphericalCoord[..., 1]*self.frame_height,
interpolation=cv2.INTER_LINEAR,
borderMode=cv2.BORDER_WRAP)
return out
then you don't need the handcrafted _bilinear_interpolation
anymore. It produces the same result.
from equirectangular-toolbox.
Hi, thanks for your solution. I also encountered this problem.
However, when I tried your solution, I found another issue.
As we know, the first pixel and the last pixel on the latitude of an equirectangular image are continuous, which means the pixel i+1 should be 0 rather than width when the pixel i is the last pixel. Therefor, I think the correct solution should be the following.
First, you can change line 62
x2 = np.add(x0, np.ones(uf.shape).astype(int)) # coords of pixel to top right
to
_x2 = np.add(x0, np.ones(uf.shape).astype(int)) # coords of pixel to top right
Then add the following after line 64:
x2 = np.mod(_x2, self.frame_width)
y2 = np.minimum(y2, self.frame_height-1)
Finally, in order to correct the bilinear interpolation, the x2
in line 80 and 81 should be changed to _x2
.
wa = np.multiply(_x2 - uf, y2 - vf)
wb = np.multiply(_x2 - uf, vf - y0)
Hope it helps.
from equirectangular-toolbox.
Hey, could you tell me how you were able to run this program please?
from equirectangular-toolbox.
Related Issues (3)
- NFOV HOT 2
- Nearest Neighbor addition? HOT 1
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 equirectangular-toolbox.