gen_spherical_mosaic ( Images : MosaicImage : CameraMatrices, RotationMatrices, LatMin, LatMax, LongMin, LongMax, LatLongStep, StackingOrder : )

Create a spherical mosaic image.

gen_spherical_mosaic creates a spherical mosaic image MosaicImage from the input images passed in Images. The pose of the images in space, which is used to compute the position of the images with respect to the surface of the sphere, can be determined with stationary_camera_self_calibration. The camera and rotation matrices computed with stationary_camera_self_calibration can be used in CameraMatrices and RotationMatrices. A spherical mosaic can only be created from images that were taken with a stationary camera (see stationary_camera_self_calibration).

The mosaic is computed in spherical coordinates (longitude and latitude). The row axis of MosaicImage corresponds to the latitude, while the column axis corresponds to the longitude. The part of the sphere that is computed by gen_spherical_mosaic is determined by LatMin, LatMax, LongMin, and LongMax. These parameters are specified in degrees and determine a rectangular part of the latitude and longitude coordinates. The latitude -90 corresponds to the north pole (i.e., the straight up viewing direction), while 90 corresponds to the south pole (i.e., the straight down viewing direction). The longitude 0 corresponds to the straight ahead viewing direction. Negative longitudes correspond to viewing directions to the left, while positive longitudes correspond to viewing directions to the right. Hence, to obtain a complete image of the sphere, LatMin = -90, LatMax = 90, LongMin = -180, and LongMax = 180 must be used. In many cases, the mosaic will not cover the entire sphere. In these cases, it is useful to select the desired part of the sphere with the above parameters. This can be done by explicitly specifying the desired rectangle. However, often it is desirable to determine the smallest rectangle that encloses all images automatically. This can be done by using LatMin < -90, LatMax > 90, LongMin < -180, and LongMax > 180. Only the parameters that lie outside the normal range of values are determined automatically.

The angle step per pixel in MosaicImage can be selected with LatLongStep, which also is an angle specified in degrees. With this, the resolution of the mosaic image can be controlled. If LatLongStep is set to 0 the angle step is calculated automatically by trying to preserve the pixel size of the original images as well as possible.

The order in which the images are added to the mosaic is given by StackingOrder. The first index in this array will end up at the bottom of the image stack while the last one will be on top. If 'default' is given instead of an array of integers, the canonical order (images in the order used in Images) will be used. If 'default' is not used, StackingOrder must contain a permutation of the numbers 1,...,n, where n is the number of images passed in Images.


Parameters

Images (input_object)
(multichannel-)image-array -> object : byte / uint2 / real
Input images.

MosaicImage (output_object)
(multichannel-)image -> object : byte / uint2 / real
Output image.

CameraMatrices (input_control)
hom_mat2d-array -> real
(Array of) 3x3 projective camera matrices that determine the interior camera parameters.

RotationMatrices (input_control)
hom_mat2d-array -> real
Array of 3x3 transformation matrices that determine rotation of the camera in the respective image.

LatMin (input_control)
angle.deg -> real / integer
Minimum latitude of points in the spherical mosaic image.
Default value: -90
Suggested values: -100, -90, -80, -70, -60, -50, -40, -30, -20, -10
Restriction: LatMin <= 90

LatMax (input_control)
angle.deg -> real / integer
Maximum latitude of points in the spherical mosaic image.
Default value: 90
Suggested values: 10, 20, 30, 40, 50, 60, 70, 80, 90, 100
Restriction: (LatMax >= -90) && (LatMax > LatMin)

LongMin (input_control)
angle.deg -> real / integer
Minimum longitude of points in the spherical mosaic image.
Default value: -180
Suggested values: -200, -180, -160, -140, -120, -100, -90, -80, -70, -60, -50, -40, -30, -20, -10
Restriction: LongMin <= 180

LongMax (input_control)
angle.deg -> real / integer
Maximum longitude of points in the spherical mosaic image.
Default value: 180
Suggested values: 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 120, 140, 160, 180, 200
Restriction: (LongMax >= -90) && (LongMax > LongMin)

LatLongStep (input_control)
angle.deg -> real / integer
Latitude and longitude angle step width.
Default value: 0.1
Suggested values: 0, 0.02, 0.05, 0.1, 0.2, 0.5, 1
Restriction: LatLongStep >= 0

StackingOrder (input_control)
string(-array) -> string / integer
Stacking order of the images in the mosaic.
Default value: 'default'
Suggested values: 'default'


Example
* For the input data to stationary_camera_self_calibration, please
* refer to the example for stationary_camera_self_calibration.
stationary_camera_self_calibration (4, 640, 480, 1, From, To,
                                    HomMatrices2D, Rows1, Cols1,
                                    Rows2, Cols2, NumMatches,
                                    'gold_standard',
                                    ['focus','principal_point'],
                                    'true', CameraMatrix, Kappa,
                                    RotationMatrices, X, Y, Z, Error)
gen_spherical_mosaic (Images, MosaicImage, CameraMatrix,
                      RotationMatrices, -100, 100, -200, 200, 0,
                      'default')

* Alternatively, if kappa should be determined, the following calls
* can be made:
stationary_camera_self_calibration (4, 640, 480, 1, From, To,
                                    HomMatrices2D, Rows1, Cols1,
                                    Rows2, Cols2, NumMatches,
                                    'gold_standard',
                                    ['focus','principal_point','kappa'],
                                    'true', CameraMatrix, Kappa,
                                    RotationMatrices, X, Y, Z, Error)
cam_mat_to_cam_par (CameraMatrix, Kappa, 640, 480, CamParam)
change_radial_distortion_cam_par ('fixed', CamParam, 0, CamParOut)
gen_radial_distortion_map (Map, CamParam, CamParOut, 'bilinear')
map_image (Images, Map, ImagesRect)
gen_spherical_mosaic (ImagesRect, MosaicImage, CameraMatrix,
                      RotationMatrices, -100, 100, -200, 200, 0,
                      'default')

Result

If the parameters are valid, the operator gen_spherical_mosaic returns the value 2 (H_MSG_TRUE). If necessary an exception handling is raised.


Parallelization Information

gen_spherical_mosaic is reentrant and processed without parallelization.


Possible Predecessors

stationary_camera_self_calibration


Alternatives

gen_projective_mosaic


References

Lourdes Agapito, E. Hayman, I. Reid: ``Self-Calibration of Rotating and Zooming Cameras''; International Journal of Computer Vision; vol. 45, no. 2; pp. 107--127; 2001.

Olivier Faugeras, Quang-Tuan Luong: ``The Geometry of Multiple Images: The Laws That Govern the Formation of Multiple Images of a Scene and Some of Their Applications''; MIT Press, Cambridge, MA; 2001.


Module

Matching



Copyright © 1996-2008 MVTec Software GmbH