gen_spherical_mosaicT_gen_spherical_mosaicGenSphericalMosaicGenSphericalMosaicgen_spherical_mosaic (Operator)

Name

gen_spherical_mosaicT_gen_spherical_mosaicGenSphericalMosaicGenSphericalMosaicgen_spherical_mosaic — Erzeugen eines sphärischen Mosaikbildes.

Signatur

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

Herror T_gen_spherical_mosaic(const Hobject Images, Hobject* MosaicImage, const Htuple CameraMatrices, const Htuple RotationMatrices, const Htuple LatMin, const Htuple LatMax, const Htuple LongMin, const Htuple LongMax, const Htuple LatLongStep, const Htuple StackingOrder, const Htuple Interpolation)

void GenSphericalMosaic(const HObject& Images, HObject* MosaicImage, const HTuple& CameraMatrices, const HTuple& RotationMatrices, const HTuple& LatMin, const HTuple& LatMax, const HTuple& LongMin, const HTuple& LongMax, const HTuple& LatLongStep, const HTuple& StackingOrder, const HTuple& Interpolation)

HImage HImage::GenSphericalMosaic(const HHomMat2DArray& CameraMatrices, const HHomMat2DArray& RotationMatrices, const HTuple& LatMin, const HTuple& LatMax, const HTuple& LongMin, const HTuple& LongMax, const HTuple& LatLongStep, const HTuple& StackingOrder, const HTuple& Interpolation) const

HImage HImage::GenSphericalMosaic(const HHomMat2DArray& CameraMatrices, const HHomMat2DArray& RotationMatrices, double LatMin, double LatMax, double LongMin, double LongMax, double LatLongStep, const HString& StackingOrder, const HString& Interpolation) const

HImage HImage::GenSphericalMosaic(const HHomMat2DArray& CameraMatrices, const HHomMat2DArray& RotationMatrices, double LatMin, double LatMax, double LongMin, double LongMax, double LatLongStep, const char* StackingOrder, const char* Interpolation) const

HImage HImage::GenSphericalMosaic(const HHomMat2DArray& CameraMatrices, const HHomMat2DArray& RotationMatrices, double LatMin, double LatMax, double LongMin, double LongMax, double LatLongStep, const wchar_t* StackingOrder, const wchar_t* Interpolation) const   (Nur Windows)

static void HOperatorSet.GenSphericalMosaic(HObject images, out HObject mosaicImage, HTuple cameraMatrices, HTuple rotationMatrices, HTuple latMin, HTuple latMax, HTuple longMin, HTuple longMax, HTuple latLongStep, HTuple stackingOrder, HTuple interpolation)

HImage HImage.GenSphericalMosaic(HHomMat2D[] cameraMatrices, HHomMat2D[] rotationMatrices, HTuple latMin, HTuple latMax, HTuple longMin, HTuple longMax, HTuple latLongStep, HTuple stackingOrder, HTuple interpolation)

HImage HImage.GenSphericalMosaic(HHomMat2D[] cameraMatrices, HHomMat2D[] rotationMatrices, double latMin, double latMax, double longMin, double longMax, double latLongStep, string stackingOrder, string interpolation)

def gen_spherical_mosaic(images: HObject, camera_matrices: Sequence[float], rotation_matrices: Sequence[float], lat_min: Union[float, int], lat_max: Union[float, int], long_min: Union[float, int], long_max: Union[float, int], lat_long_step: Union[float, int], stacking_order: MaybeSequence[Union[str, int]], interpolation: Union[str, int]) -> HObject

Beschreibung

gen_spherical_mosaicgen_spherical_mosaicGenSphericalMosaicGenSphericalMosaicGenSphericalMosaicgen_spherical_mosaic erzeugt ein sphärisches Mosaik MosaicImageMosaicImageMosaicImageMosaicImagemosaicImagemosaic_image aus den in ImagesImagesImagesImagesimagesimages übergebenen Bildern. Die Lage der Bilder im Raum, aus der die Lage der Bilder in Bezug auf die Kugeloberfläche berechnet wird, kann mit stationary_camera_self_calibrationstationary_camera_self_calibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibrationstationary_camera_self_calibration bestimmt werden. Die dort berechneten Kameramatrizen und Rotationsmatrizen können direkt in CameraMatricesCameraMatricesCameraMatricesCameraMatricescameraMatricescamera_matrices und RotationMatricesRotationMatricesRotationMatricesRotationMatricesrotationMatricesrotation_matrices übergeben werden. Ein sphärisches Mosaik kann nur von Aufnahmen einer stationären Kamera berechnet werden (siehe stationary_camera_self_calibrationstationary_camera_self_calibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibrationstationary_camera_self_calibration).

Das Mosaik wird in Kugelkoordinaten (Länge und Breite) berechnet. Dabei entspricht die Breite der Zeilenachse und die Länge der Spaltenachse von MosaicImageMosaicImageMosaicImageMosaicImagemosaicImagemosaic_image. Der berechnete Ausschnitt der Kugeloberfläche wird durch LatMinLatMinLatMinLatMinlatMinlat_min, LatMaxLatMaxLatMaxLatMaxlatMaxlat_max, LongMinLongMinLongMinLongMinlongMinlong_min und LongMaxLongMaxLongMaxLongMaxlongMaxlong_max festgelegt. Diese Parameter werden in Grad angegeben und legen einen rechteckigen Ausschnitt der Längen- und Breitenkoordinaten fest. Dabei entspricht eine Breite von -90 dem Nordpol (also der Blickrichtung senkrecht nach oben) und eine Breite von 90 dem Südpol (Blickrichtung senkrecht nach unten). Die Länge von 0 entspricht der Betrachtungsrichtung nach vorne. Negative Längen entsprechen Blickwinkeln nach links, positive Längen Blickwinkeln nach rechts. Um ein vollständiges Bild der Kugeloberfläche zu erhalten, ist also LatMinLatMinLatMinLatMinlatMinlat_min = -90, LatMaxLatMaxLatMaxLatMaxlatMaxlat_max = 90, LongMinLongMinLongMinLongMinlongMinlong_min = -180 und LongMaxLongMaxLongMaxLongMaxlongMaxlong_max = 180 zu verwenden. In vielen Fällen wird das Mosaik nicht die gesamte Kugeloberfläche abdecken. In diesem Fall ist es sinnvoll, einen Ausschnitt der Kugeloberfläche mit den obigen Parametern auszuwählen. Dies kann zum einen geschehen, indem das Rechteck explizit angegeben wird. Oftmals ist es aber wünschenswert, das kleinstmögliche Rechteck, das alle Bilder enthält, automatisch bestimmen zu lassen. Dies kann geschehen, indem LatMinLatMinLatMinLatMinlatMinlat_min < -90, LatMaxLatMaxLatMaxLatMaxlatMaxlat_max > 90, LongMinLongMinLongMinLongMinlongMinlong_min < -180 und LongMaxLongMaxLongMaxLongMaxlongMaxlong_max > 180 spezifiziert wird. Dabei werden nur diejenigen Parameter automatisch bestimmt, die außerhalb des normalen Wertebereichs liegen.

Die Winkelschrittweite pro Pixel in MosaicImageMosaicImageMosaicImageMosaicImagemosaicImagemosaic_image kann mit LatLongStepLatLongStepLatLongStepLatLongSteplatLongSteplat_long_step festgelegt werden. LatLongStepLatLongStepLatLongStepLatLongSteplatLongSteplat_long_step wird auch in Grad angegeben. Hiermit kann die Auflösung des Mosaikbildes bestimmt werden. Falls LatLongStepLatLongStepLatLongStepLatLongSteplatLongSteplat_long_step auf 0 gesetzt wird, wird die Winkelschrittweite automatisch bestimmt, indem versucht wird, die Pixelgröße der Originalbilder so gut wie möglich zu erhalten.

Der Modus, in dem die Bilder dem Mosaik hinzugefügt werden, wird durch StackingOrderStackingOrderStackingOrderStackingOrderstackingOrderstacking_order bestimmt. Für StackingOrderStackingOrderStackingOrderStackingOrderstackingOrderstacking_order = 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi" werden die Punkte im Mosaikbild aus der Voronoi-Zelle des jeweiligen Eingabebildes entnommen. Das heißt, dass die Grauwerte aus den zum Mittelpunkt des jeweiligen Bildes auf der Kugeloberfläche am nächsten gelegenen Punkten bestimmt werden. Dieser Modus hat den Vorteil, dass eventuelle Vignettierungen oder unkorrigierte radiale Verzeichnungen im Mosaik weniger auffällig sind, da sie typischerweise symmetrisch zum Bildmittelpunkt sind. Alternativ kann mit der im Folgenden beschriebenen Wahl der Parameter ein Modus gewählt werden, der denselben Effekt hat, wie wenn die Bilder nacheinander in das Mosaikbild gezeichnet würden. Hierbei ist die Reihenfolge des Eintragens der Bilder in das Mosaik wichtig. Deswegen kann in StackingOrderStackingOrderStackingOrderStackingOrderstackingOrderstacking_order ein Array von ganzen Zahlen angegeben werden. Das erste Element dieses Arrays bildet das unterste Bild des Mosaiks, während das letzte ganz oben auf dem Mosaik erscheint. Wird statt einem Array von ganzen Zahlen der Wert 'default'"default""default""default""default""default" angegeben, so wird die kanonische Ordnung (Bilder in der Reihenfolge in ImagesImagesImagesImagesimagesimages) verwendet. Wenn weder 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi" noch 'default'"default""default""default""default""default" verwendet wird, muss in StackingOrderStackingOrderStackingOrderStackingOrderstackingOrderstacking_order eine Permutation der Zahlen 1,...,n verwendet werden, wobei n die Anzahl der in ImagesImagesImagesImagesimagesimages übergebenen Bilder ist. Es ist zu beachten, dass der Modus 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi" nicht immer angewendet werden kann. So müssen z.B. mindestens zwei Bilder übergeben werden. Weiterhin können die Voronoi-Zellen für sehr spezielle Lagen der Bildmittelpunkte auf der Kugel nicht eindeutig bestimmt werden. Darüber hinaus steht mit dem Modus 'blend'"blend""blend""blend""blend""blend" ein Modus bereit, welcher die Bilder des Mosaiks weich ineinander überblendet. Als Grenzen zwischen den Bildern werden hier die gleichen Voronoi-Zellen verwendet, wie im Modus 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi". Dieser Modus liefert besonders angenehm wirkende Bilder, benötigt jedoch erheblich mehr Ressourcen. Sollte der Modus 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi" oder 'blend'"blend""blend""blend""blend""blend" aus irgendeinem Grund nicht anwendbar sein, wird intern automatisch auf den Modus 'default'"default""default""default""default""default" umgeschaltet.

Mit dem Parameter InterpolationInterpolationInterpolationInterpolationinterpolationinterpolation wird gewünschte Interpolationsmodus für die Erstellung des Mosaiks gewählt. Es besteht die Wahlmöglichkeit zwischen bilinearer und bikubischer Interpolation für alle Modi von StackingOrderStackingOrderStackingOrderStackingOrderstackingOrderstacking_order. 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor" ist nur verfügbar wenn für StackingOrderStackingOrderStackingOrderStackingOrderstackingOrderstacking_order 'default'"default""default""default""default""default" oder 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi" gewählt ist.

Ausführungsinformationen

Parameter

ImagesImagesImagesImagesimagesimages (input_object)  (multichannel-)image-array objectHImageHObjectHImageHobject (byte / uint2 / real)

Eingabebilder.

MosaicImageMosaicImageMosaicImageMosaicImagemosaicImagemosaic_image (output_object)  (multichannel-)image objectHImageHObjectHImageHobject * (byte / uint2 / real)

Ergebnisbild.

CameraMatricesCameraMatricesCameraMatricesCameraMatricescameraMatricescamera_matrices (input_control)  hom_mat2d-array HHomMat2D, HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

(Array von) 3x3 projektiven Kameramatrizen, die die internen Kameraparameter bestimmen.

RotationMatricesRotationMatricesRotationMatricesRotationMatricesrotationMatricesrotation_matrices (input_control)  hom_mat2d-array HHomMat2D, HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Array von 3x3 Transformationsmatrizen, die die Rotation der Kamera im jeweiligen Bild bestimmen.

LatMinLatMinLatMinLatMinlatMinlat_min (input_control)  angle.deg HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Minimaler Breitengrad der Punkte im sphärischen Mosaik.

Defaultwert: -90

Wertevorschläge: -100, -90, -80, -70, -60, -50, -40, -30, -20, -10

Restriktion: LatMin <= 90

LatMaxLatMaxLatMaxLatMaxlatMaxlat_max (input_control)  angle.deg HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Maximaler Breitengrad der Punkte im sphärischen Mosaik.

Defaultwert: 90

Wertevorschläge: 10, 20, 30, 40, 50, 60, 70, 80, 90, 100

Restriktion: LatMax >= -90 && LatMax > LatMin

LongMinLongMinLongMinLongMinlongMinlong_min (input_control)  angle.deg HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Minimaler Längengrad der Punkte im sphärischen Mosaik.

Defaultwert: -180

Wertevorschläge: -200, -180, -160, -140, -120, -100, -90, -80, -70, -60, -50, -40, -30, -20, -10

Restriktion: LongMin <= 180

LongMaxLongMaxLongMaxLongMaxlongMaxlong_max (input_control)  angle.deg HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Maximaler Längengrad der Punkte im sphärischen Mosaik.

Defaultwert: 180

Wertevorschläge: 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 120, 140, 160, 180, 200

Restriktion: LongMax >= -90 && LongMax > LongMin

LatLongStepLatLongStepLatLongStepLatLongSteplatLongSteplat_long_step (input_control)  angle.deg HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Winkelschrittweite der Längen und Breiten.

Defaultwert: 0.1

Wertevorschläge: 0, 0.02, 0.05, 0.1, 0.2, 0.5, 1

Restriktion: LatLongStep >= 0

StackingOrderStackingOrderStackingOrderStackingOrderstackingOrderstacking_order (input_control)  string(-array) HTupleMaybeSequence[Union[str, int]]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

Modus des Eintragens der Bilder in das Mosaik.

Defaultwert: 'voronoi' "voronoi" "voronoi" "voronoi" "voronoi" "voronoi"

Wertevorschläge: 'blend'"blend""blend""blend""blend""blend", 'voronoi'"voronoi""voronoi""voronoi""voronoi""voronoi", 'default'"default""default""default""default""default"

InterpolationInterpolationInterpolationInterpolationinterpolationinterpolation (input_control)  string HTupleUnion[str, int]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

Interpolationsmodus für die Berechnung des Mosaiks.

Defaultwert: 'bilinear' "bilinear" "bilinear" "bilinear" "bilinear" "bilinear"

Wertevorschläge: 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor", 'bilinear'"bilinear""bilinear""bilinear""bilinear""bilinear", 'bicubic'"bicubic""bicubic""bicubic""bicubic""bicubic"

Beispiel (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_spherical_mosaic (Images, MosaicImage, CameraMatrix, \
                      RotationMatrices, -100, 100, -200, 200, 0, \
                      'default','bilinear')

* 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','bilinear')

Ergebnis

Sind die Parameterwerte korrekt, dann liefert gen_spherical_mosaicgen_spherical_mosaicGenSphericalMosaicGenSphericalMosaicGenSphericalMosaicgen_spherical_mosaic den Wert 2 (H_MSG_TRUE). Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

stationary_camera_self_calibrationstationary_camera_self_calibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibrationstationary_camera_self_calibration

Alternativen

gen_cube_map_mosaicgen_cube_map_mosaicGenCubeMapMosaicGenCubeMapMosaicGenCubeMapMosaicgen_cube_map_mosaic, gen_projective_mosaicgen_projective_mosaicGenProjectiveMosaicGenProjectiveMosaicGenProjectiveMosaicgen_projective_mosaic

Literatur

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.

Modul

Matching