Latitude = photo_height_deg * (y - photo_height_px/2) / photo_height_px + vaīut this approximation does not work at all when we move the camera much more vertically: Longitude = photo_width_deg * (x - photo_width_px/2) / photo_width_px + ha If we don't care about a slight distortion, then the formula to calculate the (longitude,latitude) from any pixel (x,y) from the photo would be easy: photo_width_deg = 70 Then this is pretty straightforward, because if we know that the photo is 70 degrees wide and 40 degrees high, then we also know that the longitude range will be approximately 70 degrees and latitude range 40 degrees. Here we look at roughly the horizon of our world. For a simple panorama photo of the horizon there is not much of a problem: If you are looking at the horizon (equator), then vertical pixels account for latitude, and horizontal pixels account for longitude. The photo will be a rectangular shape on this sphere (from perspective of the camera). Then we can consider a sphere of any radius (for the math, it is highly recommended to use a radius of 1). If photos are taken from a fixed point, and the camera can only rotate its yaw and pitch around that point. Blue shows the difference in transformation, but this depends on the horizontal/vertical angle. So, I have Red, and I need to transform it into Green. The figure below illustrates the problem. The problem is that a given photo Red cannot be placed into the equirectangular projection without a transformation. These results did not help me with answering my question.ĮDIT: I figured that maybe a figure will help explaining it better :) Either I do not fully understand it, or search engines are not helping me, because most results are about converting between already given projections or use advanced applications to stitch photos intelligently together. The transformation that is applied to the image to correct this is straightforward. And this can be done using imagemagick's Barrel Distortion, in which you only need to fill in three parameters: a, b, and c. I have this data, and I guess the first step is to do lens correction so that all lines that should be straight are in fact straight. Lens correction a, b, c parameters (see below).Vertical angle of physical camera (e.g. Horizontal angle of physical camera (e.g.The data that I think is required to do this, is probably something like this: It is safe to assume that the camera will stay at a fixed location, and can rotate in any direction from there. I just don't know how to do the step from an actual photo to such a projection. Whichever projection is easiest to do is good enough, because there are plenty of resources on how to convert between different projections. ContextĮdit: The original question title was: How to transform a photo at a given angle to become a part of a panorama photo?Ĭan anybody help me with which steps I should take if I want to transform a photo taken at any given angle in such a way that I can place the resulting (distorted/transformed) image at the corresponding specific location on an equirectangular projection, cube map, or any panorama photo projection? φ is phi, the vertical angle in degrees, a vector from (0,0,0) to a point on the surface of a sphere.īelow you find the original question, back when I did not understand the problem well, but I think that it is still good for showing what is a practical application of this solution.θ is theta, the horizontal angle in degrees, a vector from (0,0,0) to a point on the surface of a sphere.y is latitude, the vertical position, from -90 to 90 degrees.x is longitude, the horizontal position, from -180 to 180 degrees.Click OK to start the stitching process.How do you convert a spherical coordinate (θ, φ) into a position (x, y) on an equirectangular projection (also called 'geographic projection')? In the Photomerge dialog box, select the Use Auto Layout option and then select the images that you want to use in your panorama. Once you have your images, open them in Photoshop and select File > Automate > Photomerge. You should also try to use images that were taken with a wide-angle lens, as this will give you a wider field of view and make it easier to overlap the images. The more images you have, the higher the quality of your final panorama will be. To make a spherical panorama in Photoshop, you will need at least two images that overlap by about 30%. In Photoshop, you can create a 360-degree panorama from a series of images by using the Photomerge command. They can be created using specialised panoramic cameras, or they can be stitched together from a number of regular photographs. A spherical panorama is an image that covers 360 degrees of horizontal field of view, as well as 180 degrees of vertical field of view.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |