Package boofcv.alg.distort.spherical
Class EquirectangularTools_F64
java.lang.Object
boofcv.alg.distort.spherical.EquirectangularTools_F64
Contains common operations for handling coordinates in an equirectangular image.
On most globes, a positive latitude corresponds to the north pole, or up, and negative towards the south pole.
Images have 0 on the top and increase downwards. To compensate for this the y-axis can be flipped. This
is indicated by functions with FV (flip vertical) on the end of their name.
Coordinate System:
- longitude is along the x-axis and goes from -pi to pi
- latitude is along the y-axis and goes from -pi/2 to pi/2
- image center (width/2, (height-1)/2.0f) or (lat=0, lon=0) corresponds to a unit sphere of (1,0,0)
- unit sphere of (0,0,1) is pixel (width/2,0) and (0,0,-1) is (width/2,height-1)
- unit sphere of (0,1,0) is pixel (3*width/4,(height-1)/2) and (0,0,-1) is (width/4,(height-1)/2)
- longitude is along the x-axis and goes from -pi to pi
- latitude is along the y-axis and goes from pi/2 to -pi/2
- image center (width/2, height/2) or (lat=0, lon=0) corresponds to a unit sphere of (1,0,0)
- unit sphere of (0,0,1) is pixel (width/2,height-1) and (0,0,-1) is (width/2,0)
- unit sphere of (0,1,0) is pixel (3*width/4,(height-1)/2) and (0,0,-1) is (width/4,(height-1)/2)
Latitude and Longitude shown on a sphere in equirectangular format. Note that y is NOT flipped and angles are shown in degrees not radians git push.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(int width, int height) Specifies the image and which latitude/longtiude will comprise the center axisesvoid
equiToLatLon
(double x, double y, GeoLL_F64 geo) Converts the equirectangular coordinate into a latitude and longitudevoid
equiToLatLonFV
(double x, double y, GeoLL_F64 geo) Converts the equirectangular coordinate into a latitude and longitude.void
equiToNorm
(double x, double y, Point3D_F64 norm) Converts equirectangular into normalized pointing vectorvoid
equiToNormFV
(double x, double y, Point3D_F64 norm) int
int
getWidth()
void
latlonToEqui
(double lat, double lon, Point2D_F64 rect) Convert from latitude-longitude coordinates into equirectangular coordinatesvoid
latlonToEquiFV
(double lat, double lon, Point2D_F64 rect) Convert from latitude-longitude coordinates into equirectangular coordinates.void
normToEqui
(double nx, double ny, double nz, Point2D_F64 rect) void
normToEquiFV
(double nx, double ny, double nz, Point2D_F64 rect)
-
Constructor Details
-
EquirectangularTools_F64
public EquirectangularTools_F64()
-
-
Method Details
-
configure
public void configure(int width, int height) Specifies the image and which latitude/longtiude will comprise the center axises- Parameters:
width
- Image widthheight
- Image height
-
equiToNorm
Converts equirectangular into normalized pointing vector- Parameters:
x
- pixel coordinate in equirectangular imagey
- pixel coordinate in equirectangular imagenorm
- Normalized pointing vector
-
normToEqui
-
equiToNormFV
-
normToEquiFV
-
equiToLatLon
Converts the equirectangular coordinate into a latitude and longitude- Parameters:
x
- pixel coordinate in equirectangular imagey
- pixel coordinate in equirectangular imagegeo
- (output)
-
equiToLatLonFV
Converts the equirectangular coordinate into a latitude and longitude. Vertical equirectangular axis has been flipped
y' = height - y - 1- Parameters:
x
- pixel coordinate in equirectangular imagey
- pixel coordinate in equirectangular imagegeo
- (output)
-
latlonToEqui
Convert from latitude-longitude coordinates into equirectangular coordinates- Parameters:
lat
- Latitudelon
- Longituderect
- (Output) equirectangular coordinate
-
latlonToEquiFV
Convert from latitude-longitude coordinates into equirectangular coordinates. Vertical equirectangular axis has been flipped- Parameters:
lat
- Latitudelon
- Longituderect
- (Output) equirectangular coordinate
-
getWidth
public int getWidth() -
getHeight
public int getHeight()
-