ClassesClassesClassesClasses | | | | Operators

gen_cube_map_mosaicT_gen_cube_map_mosaicGenCubeMapMosaicgen_cube_map_mosaicGenCubeMapMosaicGenCubeMapMosaic (Operator)

Name

gen_cube_map_mosaicT_gen_cube_map_mosaicGenCubeMapMosaicgen_cube_map_mosaicGenCubeMapMosaicGenCubeMapMosaic — Create 6 cube map images of a spherical mosaic.

Signature

gen_cube_map_mosaic(Images : Front, Rear, Left, Right, Top, Bottom : CameraMatrices, RotationMatrices, CubeMapDimension, StackingOrder, Interpolation : )

Herror T_gen_cube_map_mosaic(const Hobject Images, Hobject* Front, Hobject* Rear, Hobject* Left, Hobject* Right, Hobject* Top, Hobject* Bottom, const Htuple CameraMatrices, const Htuple RotationMatrices, const Htuple CubeMapDimension, const Htuple StackingOrder, const Htuple Interpolation)

Herror gen_cube_map_mosaic(Hobject Images, Hobject* Front, Hobject* Rear, Hobject* Left, Hobject* Right, Hobject* Top, Hobject* Bottom, const HTuple& CameraMatrices, const HTuple& RotationMatrices, const HTuple& CubeMapDimension, const HTuple& StackingOrder, const HTuple& Interpolation)

HImage HImageArray::GenCubeMapMosaic(HImage* Rear, HImage* Left, HImage* Right, HImage* Top, HImage* Bottom, const HTuple& CameraMatrices, const HTuple& RotationMatrices, const HTuple& CubeMapDimension, const HTuple& StackingOrder, const HTuple& Interpolation) const

void GenCubeMapMosaic(const HObject& Images, HObject* Front, HObject* Rear, HObject* Left, HObject* Right, HObject* Top, HObject* Bottom, const HTuple& CameraMatrices, const HTuple& RotationMatrices, const HTuple& CubeMapDimension, const HTuple& StackingOrder, const HTuple& Interpolation)

HImage HImage::GenCubeMapMosaic(HImage* Rear, HImage* Left, HImage* Right, HImage* Top, HImage* Bottom, const HHomMat2DArray& CameraMatrices, const HHomMat2DArray& RotationMatrices, Hlong CubeMapDimension, const HTuple& StackingOrder, const HString& Interpolation) const

HImage HImage::GenCubeMapMosaic(HImage* Rear, HImage* Left, HImage* Right, HImage* Top, HImage* Bottom, const HHomMat2DArray& CameraMatrices, const HHomMat2DArray& RotationMatrices, Hlong CubeMapDimension, const HString& StackingOrder, const HString& Interpolation) const

HImage HImage::GenCubeMapMosaic(HImage* Rear, HImage* Left, HImage* Right, HImage* Top, HImage* Bottom, const HHomMat2DArray& CameraMatrices, const HHomMat2DArray& RotationMatrices, Hlong CubeMapDimension, const char* StackingOrder, const char* Interpolation) const

void HOperatorSetX.GenCubeMapMosaic(
[in] IHUntypedObjectX* Images, [out] IHUntypedObjectX*Front, [out] IHUntypedObjectX*Rear, [out] IHUntypedObjectX*Left, [out] IHUntypedObjectX*Right, [out] IHUntypedObjectX*Top, [out] IHUntypedObjectX*Bottom, [in] VARIANT CameraMatrices, [in] VARIANT RotationMatrices, [in] VARIANT CubeMapDimension, [in] VARIANT StackingOrder, [in] VARIANT Interpolation)

IHImageX* HImageX.GenCubeMapMosaic(
[out] IHImageX*Rear, [out] IHImageX*Left, [out] IHImageX*Right, [out] IHImageX*Top, [out] IHImageX*Bottom, [in] IHHomMat2DX* CameraMatrices, [in] IHHomMat2DX* RotationMatrices, [in] Hlong CubeMapDimension, [in] VARIANT StackingOrder, [in] BSTR Interpolation)

static void HOperatorSet.GenCubeMapMosaic(HObject images, out HObject front, out HObject rear, out HObject left, out HObject right, out HObject top, out HObject bottom, HTuple cameraMatrices, HTuple rotationMatrices, HTuple cubeMapDimension, HTuple stackingOrder, HTuple interpolation)

HImage HImage.GenCubeMapMosaic(out HImage rear, out HImage left, out HImage right, out HImage top, out HImage bottom, HHomMat2D[] cameraMatrices, HHomMat2D[] rotationMatrices, int cubeMapDimension, HTuple stackingOrder, string interpolation)

HImage HImage.GenCubeMapMosaic(out HImage rear, out HImage left, out HImage right, out HImage top, out HImage bottom, HHomMat2D[] cameraMatrices, HHomMat2D[] rotationMatrices, int cubeMapDimension, string stackingOrder, string interpolation)

Description

gen_cube_map_mosaicgen_cube_map_mosaicGenCubeMapMosaicgen_cube_map_mosaicGenCubeMapMosaicGenCubeMapMosaic creates 6 cube map images of a spherical mosaic FrontFrontFrontFrontFrontfront, LeftLeftLeftLeftLeftleft, RearRearRearRearRearrear, RightRightRightRightRightright, TopTopTopTopToptop and BottomBottomBottomBottomBottombottom from the input images passed in ImagesImagesImagesImagesImagesimages. 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_calibrationstationary_camera_self_calibrationStationaryCameraSelfCalibrationstationary_camera_self_calibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibration. The camera and rotation matrices computed with stationary_camera_self_calibrationstationary_camera_self_calibrationStationaryCameraSelfCalibrationstationary_camera_self_calibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibration can be used in CameraMatricesCameraMatricesCameraMatricesCameraMatricesCameraMatricescameraMatrices and RotationMatricesRotationMatricesRotationMatricesRotationMatricesRotationMatricesrotationMatrices. A spherical mosaic can only be created from images that were taken with a stationary camera (see stationary_camera_self_calibrationstationary_camera_self_calibrationStationaryCameraSelfCalibrationstationary_camera_self_calibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibration).

The width and height of the output cube map images can be selected by setting the parameter CubeMapDimensionCubeMapDimensionCubeMapDimensionCubeMapDimensionCubeMapDimensioncubeMapDimension. The value represents the width and height in pixels.

The mode in which the images are added to the mosaic is given by StackingOrderStackingOrderStackingOrderStackingOrderStackingOrderstackingOrder. For StackingOrderStackingOrderStackingOrderStackingOrderStackingOrderstackingOrder = 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi", the points in the mosaic image are determined from the Voronoi cell of the respective input image. This means that the gray values are taken from the points of the input image to whose center the pixel in the mosaic image has the smallest distance on the sphere. This mode has the advantage that vignetting and uncorrected radial distortions are less noticeable in the mosaic image because they typically are symmetric with respect to the image center. Alternatively, with the choice of parameters described in the following, a mode can be selected that has the same effect as if the images were painted successively into the mosaic image. Here, the order in which the images are added to the mosaic image is important. Therefore, an array of integer values can be passed in StackingOrderStackingOrderStackingOrderStackingOrderStackingOrderstackingOrder. 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'"default""default""default""default""default" is given instead of an array of integers, the canonical order (images in the order used in ImagesImagesImagesImagesImagesimages) will be used. Hence, if neither 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi" nor 'default'"default""default""default""default""default" are used, StackingOrderStackingOrderStackingOrderStackingOrderStackingOrderstackingOrder must contain a permutation of the numbers 1,...,n, where n is the number of images passed in ImagesImagesImagesImagesImagesimages. It should be noted that the mode 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi" cannot always be used. For example, at least two images must be passed to use this mode. Furthermore, for very special configurations of the positions of the image centers on the sphere, the Voronoi cells cannot be determined uniquely. With StackingOrderStackingOrderStackingOrderStackingOrderStackingOrderstackingOrder = 'blend'"blend""blend""blend""blend""blend", an additional mode is available, which blends the images of the mosaic smoothly. This way seams between the images become less apparent. The seam lines between the images are the same as in 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi". This mode leads to visually more appealing images, but requires significantly more resources. If the mode 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi" or 'blend'"blend""blend""blend""blend""blend" cannot be used for whatever reason the mode is switched internally to 'default'"default""default""default""default""default" automatically.

The parameter InterpolationInterpolationInterpolationInterpolationInterpolationinterpolation selects the desired interpolation mode for creating the cube maps. 'bilinear'"bilinear""bilinear""bilinear""bilinear""bilinear" and 'bicubic'"bicubic""bicubic""bicubic""bicubic""bicubic" interpolation is available for all modes of StackingOrderStackingOrderStackingOrderStackingOrderStackingOrderstackingOrder. 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor" is only available if StackingOrderStackingOrderStackingOrderStackingOrderStackingOrderstackingOrder is set to 'default'"default""default""default""default""default" or 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi".

Parallelization

Parameters

ImagesImagesImagesImagesImagesimages (input_object)  (multichannel-)image-array objectHImageHImageHImageArrayHImageXHobject (byte / uint2 / real)

Input images.

FrontFrontFrontFrontFrontfront (output_object)  (multichannel-)image objectHImageHImageHImageHImageXHobject * (byte / uint2 / real)

Front cube map.

RearRearRearRearRearrear (output_object)  (multichannel-)image objectHImageHImageHImageHImageXHobject * (byte / uint2 / real)

Rear cube map.

LeftLeftLeftLeftLeftleft (output_object)  (multichannel-)image objectHImageHImageHImageHImageXHobject * (byte / uint2 / real)

Left cube map.

RightRightRightRightRightright (output_object)  (multichannel-)image objectHImageHImageHImageHImageXHobject * (byte / uint2 / real)

Right cube map.

TopTopTopTopToptop (output_object)  (multichannel-)image objectHImageHImageHImageHImageXHobject * (byte / uint2 / real)

Top cube map.

BottomBottomBottomBottomBottombottom (output_object)  (multichannel-)image objectHImageHImageHImageHImageXHobject * (byte / uint2 / real)

Bottom cube map.

CameraMatricesCameraMatricesCameraMatricesCameraMatricesCameraMatricescameraMatrices (input_control)  hom_mat2d-array HHomMat2D, HTupleHTupleHTupleHHomMat2DX, VARIANTHtuple (real) (double) (double) (double) (double) (double)

(Array of) 3x3 projective camera matrices that determine the internal camera parameters.

RotationMatricesRotationMatricesRotationMatricesRotationMatricesRotationMatricesrotationMatrices (input_control)  hom_mat2d-array HHomMat2D, HTupleHTupleHTupleHHomMat2DX, VARIANTHtuple (real) (double) (double) (double) (double) (double)

Array of 3x3 transformation matrices that determine rotation of the camera in the respective image.

CubeMapDimensionCubeMapDimensionCubeMapDimensionCubeMapDimensionCubeMapDimensioncubeMapDimension (input_control)  number HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Width and height of the resulting cube maps.

Default value: 1000

Restriction: CubeMapDimension >= 0

StackingOrderStackingOrderStackingOrderStackingOrderStackingOrderstackingOrder (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong) (BSTR / Hlong) (char* / Hlong)

Mode of adding the images to the mosaic image.

Default value: 'voronoi' "voronoi" "voronoi" "voronoi" "voronoi" "voronoi"

Suggested values: 'blend'"blend""blend""blend""blend""blend", 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi", 'default'"default""default""default""default""default"

InterpolationInterpolationInterpolationInterpolationInterpolationinterpolation (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Mode of image interpolation.

Default value: 'bilinear' "bilinear" "bilinear" "bilinear" "bilinear" "bilinear"

Suggested values: 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor", 'bilinear'"bilinear""bilinear""bilinear""bilinear""bilinear", 'bicubic'"bicubic""bicubic""bicubic""bicubic""bicubic"

Example (HDevelop)

* 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_cube_map_mosaic (Images, Front, Left, Rear, Right, Top, Bottom, \
                     CameraMatrix, RotationMatrices, 1000, 'default', \
                     'bicubic')

* 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_cube_map_mosaic (Images, Front, Left, Rear, Right, Top, Bottom, \
                     CameraMatrix, RotationMatrices, 1000, 'default', \
                     'bicubic')

Result

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

Possible Predecessors

stationary_camera_self_calibrationstationary_camera_self_calibrationStationaryCameraSelfCalibrationstationary_camera_self_calibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibration

Alternatives

gen_spherical_mosaicgen_spherical_mosaicGenSphericalMosaicgen_spherical_mosaicGenSphericalMosaicGenSphericalMosaic, gen_projective_mosaicgen_projective_mosaicGenProjectiveMosaicgen_projective_mosaicGenProjectiveMosaicGenProjectiveMosaic

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


ClassesClassesClassesClasses | | | | Operators