gen_spherical_mosaicT_gen_spherical_mosaicGenSphericalMosaicGenSphericalMosaic (Operator)

Name

gen_spherical_mosaicT_gen_spherical_mosaicGenSphericalMosaicGenSphericalMosaic — 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)

Beschreibung

gen_spherical_mosaicgen_spherical_mosaicGenSphericalMosaicGenSphericalMosaicGenSphericalMosaic erzeugt ein sphärisches Mosaik MosaicImageMosaicImageMosaicImageMosaicImagemosaicImage aus den in ImagesImagesImagesImagesimages ü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_calibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibration bestimmt werden. Die dort berechneten Kameramatrizen und Rotationsmatrizen können direkt in CameraMatricesCameraMatricesCameraMatricesCameraMatricescameraMatrices und RotationMatricesRotationMatricesRotationMatricesRotationMatricesrotationMatrices übergeben werden. Ein sphärisches Mosaik kann nur von Aufnahmen einer stationären Kamera berechnet werden (siehe stationary_camera_self_calibrationstationary_camera_self_calibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibration).

Das Mosaik wird in Kugelkoordinaten (Länge und Breite) berechnet. Dabei entspricht die Breite der Zeilenachse und die Länge der Spaltenachse von MosaicImageMosaicImageMosaicImageMosaicImagemosaicImage. Der berechnete Ausschnitt der Kugeloberfläche wird durch LatMinLatMinLatMinLatMinlatMin, LatMaxLatMaxLatMaxLatMaxlatMax, LongMinLongMinLongMinLongMinlongMin und LongMaxLongMaxLongMaxLongMaxlongMax 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 LatMinLatMinLatMinLatMinlatMin = -90, LatMaxLatMaxLatMaxLatMaxlatMax = 90, LongMinLongMinLongMinLongMinlongMin = -180 und LongMaxLongMaxLongMaxLongMaxlongMax = 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 LatMinLatMinLatMinLatMinlatMin < -90, LatMaxLatMaxLatMaxLatMaxlatMax > 90, LongMinLongMinLongMinLongMinlongMin < -180 und LongMaxLongMaxLongMaxLongMaxlongMax > 180 spezifiziert wird. Dabei werden nur diejenigen Parameter automatisch bestimmt, die außerhalb des normalen Wertebereichs liegen.

Die Winkelschrittweite pro Pixel in MosaicImageMosaicImageMosaicImageMosaicImagemosaicImage kann mit LatLongStepLatLongStepLatLongStepLatLongSteplatLongStep festgelegt werden. LatLongStepLatLongStepLatLongStepLatLongSteplatLongStep wird auch in Grad angegeben. Hiermit kann die Auflösung des Mosaikbildes bestimmt werden. Falls LatLongStepLatLongStepLatLongStepLatLongSteplatLongStep 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 StackingOrderStackingOrderStackingOrderStackingOrderstackingOrder bestimmt. Für StackingOrderStackingOrderStackingOrderStackingOrderstackingOrder = '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 StackingOrderStackingOrderStackingOrderStackingOrderstackingOrder 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" angegeben, so wird die kanonische Ordnung (Bilder in der Reihenfolge in ImagesImagesImagesImagesimages) verwendet. Wenn weder 'voronoi'"voronoi""voronoi""voronoi""voronoi" noch 'default'"default""default""default""default" verwendet wird, muss in StackingOrderStackingOrderStackingOrderStackingOrderstackingOrder eine Permutation der Zahlen 1,...,n verwendet werden, wobei n die Anzahl der in ImagesImagesImagesImagesimages übergebenen Bilder ist. Es ist zu beachten, dass der Modus '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" 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". Dieser Modus liefert besonders angenehm wirkende Bilder, benötigt jedoch erheblich mehr Ressourcen. Sollte der Modus 'voronoi'"voronoi""voronoi""voronoi""voronoi" oder 'blend'"blend""blend""blend""blend" aus irgendeinem Grund nicht anwendbar sein, wird intern automatisch auf den Modus 'default'"default""default""default""default" umgeschaltet.

Mit dem Parameter InterpolationInterpolationInterpolationInterpolationinterpolation 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 StackingOrderStackingOrderStackingOrderStackingOrderstackingOrder. 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor" ist nur verfügbar wenn für StackingOrderStackingOrderStackingOrderStackingOrderstackingOrder 'default'"default""default""default""default" oder 'voronoi'"voronoi""voronoi""voronoi""voronoi" gewählt ist.

Ausführungsinformationen

Parameter

ImagesImagesImagesImagesimages (input_object)  (multichannel-)image-array objectHImageHImageHobject (byte / uint2 / real)

Eingabebilder.

MosaicImageMosaicImageMosaicImageMosaicImagemosaicImage (output_object)  (multichannel-)image objectHImageHImageHobject * (byte / uint2 / real)

Ergebnisbild.

CameraMatricesCameraMatricesCameraMatricesCameraMatricescameraMatrices (input_control)  hom_mat2d-array HHomMat2D, HTupleHTupleHtuple (real) (double) (double) (double)

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

RotationMatricesRotationMatricesRotationMatricesRotationMatricesrotationMatrices (input_control)  hom_mat2d-array HHomMat2D, HTupleHTupleHtuple (real) (double) (double) (double)

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

LatMinLatMinLatMinLatMinlatMin (input_control)  angle.deg HTupleHTupleHtuple (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

LatMaxLatMaxLatMaxLatMaxlatMax (input_control)  angle.deg HTupleHTupleHtuple (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

LongMinLongMinLongMinLongMinlongMin (input_control)  angle.deg HTupleHTupleHtuple (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

LongMaxLongMaxLongMaxLongMaxlongMax (input_control)  angle.deg HTupleHTupleHtuple (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

LatLongStepLatLongStepLatLongStepLatLongSteplatLongStep (input_control)  angle.deg HTupleHTupleHtuple (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

StackingOrderStackingOrderStackingOrderStackingOrderstackingOrder (input_control)  string(-array) HTupleHTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

Modus des Eintragens der Bilder in das Mosaik.

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

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

InterpolationInterpolationInterpolationInterpolationinterpolation (input_control)  string HTupleHTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

Interpolationsmodus für die Berechnung des Mosaiks.

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

Wertevorschläge: 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor", 'bilinear'"bilinear""bilinear""bilinear""bilinear", '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_mosaicGenSphericalMosaicGenSphericalMosaicGenSphericalMosaic den Wert 2 (H_MSG_TRUE). Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

stationary_camera_self_calibrationstationary_camera_self_calibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibrationStationaryCameraSelfCalibration

Alternativen

gen_cube_map_mosaicgen_cube_map_mosaicGenCubeMapMosaicGenCubeMapMosaicGenCubeMapMosaic, gen_projective_mosaicgen_projective_mosaicGenProjectiveMosaicGenProjectiveMosaicGenProjectiveMosaic

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