bundle_adjust_mosaicT_bundle_adjust_mosaicBundleAdjustMosaicBundleAdjustMosaic (Operator)

Name

bundle_adjust_mosaicT_bundle_adjust_mosaicBundleAdjustMosaicBundleAdjustMosaic — Bündelausgleichung eines Mosaiks.

Signatur

bundle_adjust_mosaic( : : NumImages, ReferenceImage, MappingSource, MappingDest, HomMatrices2D, Rows1, Cols1, Rows2, Cols2, NumCorrespondences, Transformation : MosaicMatrices2D, Rows, Cols, Error)

Herror T_bundle_adjust_mosaic(const Htuple NumImages, const Htuple ReferenceImage, const Htuple MappingSource, const Htuple MappingDest, const Htuple HomMatrices2D, const Htuple Rows1, const Htuple Cols1, const Htuple Rows2, const Htuple Cols2, const Htuple NumCorrespondences, const Htuple Transformation, Htuple* MosaicMatrices2D, Htuple* Rows, Htuple* Cols, Htuple* Error)

void BundleAdjustMosaic(const HTuple& NumImages, const HTuple& ReferenceImage, const HTuple& MappingSource, const HTuple& MappingDest, const HTuple& HomMatrices2D, const HTuple& Rows1, const HTuple& Cols1, const HTuple& Rows2, const HTuple& Cols2, const HTuple& NumCorrespondences, const HTuple& Transformation, HTuple* MosaicMatrices2D, HTuple* Rows, HTuple* Cols, HTuple* Error)

static HHomMat2DArray HHomMat2D::BundleAdjustMosaic(Hlong NumImages, Hlong ReferenceImage, const HTuple& MappingSource, const HTuple& MappingDest, const HHomMat2DArray& HomMatrices2D, const HTuple& Rows1, const HTuple& Cols1, const HTuple& Rows2, const HTuple& Cols2, const HTuple& NumCorrespondences, const HString& Transformation, HTuple* Rows, HTuple* Cols, HTuple* Error)

static HHomMat2DArray HHomMat2D::BundleAdjustMosaic(Hlong NumImages, Hlong ReferenceImage, const HTuple& MappingSource, const HTuple& MappingDest, const HHomMat2DArray& HomMatrices2D, const HTuple& Rows1, const HTuple& Cols1, const HTuple& Rows2, const HTuple& Cols2, const HTuple& NumCorrespondences, const HString& Transformation, HTuple* Rows, HTuple* Cols, double* Error)

static HHomMat2DArray HHomMat2D::BundleAdjustMosaic(Hlong NumImages, Hlong ReferenceImage, const HTuple& MappingSource, const HTuple& MappingDest, const HHomMat2DArray& HomMatrices2D, const HTuple& Rows1, const HTuple& Cols1, const HTuple& Rows2, const HTuple& Cols2, const HTuple& NumCorrespondences, const char* Transformation, HTuple* Rows, HTuple* Cols, double* Error)

static HHomMat2DArray HHomMat2D::BundleAdjustMosaic(Hlong NumImages, Hlong ReferenceImage, const HTuple& MappingSource, const HTuple& MappingDest, const HHomMat2DArray& HomMatrices2D, const HTuple& Rows1, const HTuple& Cols1, const HTuple& Rows2, const HTuple& Cols2, const HTuple& NumCorrespondences, const wchar_t* Transformation, HTuple* Rows, HTuple* Cols, double* Error)   (Nur Windows)

static void HOperatorSet.BundleAdjustMosaic(HTuple numImages, HTuple referenceImage, HTuple mappingSource, HTuple mappingDest, HTuple homMatrices2D, HTuple rows1, HTuple cols1, HTuple rows2, HTuple cols2, HTuple numCorrespondences, HTuple transformation, out HTuple mosaicMatrices2D, out HTuple rows, out HTuple cols, out HTuple error)

static HHomMat2D[] HHomMat2D.BundleAdjustMosaic(int numImages, int referenceImage, HTuple mappingSource, HTuple mappingDest, HHomMat2D[] homMatrices2D, HTuple rows1, HTuple cols1, HTuple rows2, HTuple cols2, HTuple numCorrespondences, string transformation, out HTuple rows, out HTuple cols, out HTuple error)

static HHomMat2D[] HHomMat2D.BundleAdjustMosaic(int numImages, int referenceImage, HTuple mappingSource, HTuple mappingDest, HHomMat2D[] homMatrices2D, HTuple rows1, HTuple cols1, HTuple rows2, HTuple cols2, HTuple numCorrespondences, string transformation, out HTuple rows, out HTuple cols, out double error)

Beschreibung

bundle_adjust_mosaicbundle_adjust_mosaicBundleAdjustMosaicBundleAdjustMosaicBundleAdjustMosaic führt eine Bündelausgleichung eines Mosaiks durch. Dies kann dazu verwendet werden, die Geometrie eines Mosaiks möglichst stabil zu berechnen und somit die Abbildungen des Mosaiks genauer zu berechnen, als dies mit den einzelnen Bildpaaren möglich ist.

Um dies zu erreichen, sollte mit proj_match_points_ransacproj_match_points_ransacProjMatchPointsRansacProjMatchPointsRansacProjMatchPointsRansac für jedes überlappende Bildpaar die projektive Abbildung zwischen den zwei beteiligten Bildern bestimmt werden. So sind z.B. für einen 2×2 Block von Bildern in folgender Anordnung

1 2
3 4

unter der Annahme, dass sich alle Bilder gegenseitig überlappen, folgende projektive Abbildungen zu bestimmen: 1->2, 1->3, 1->4, 2->3, 2->4 und 3->4. Die Indizes der Bilder, die die jeweilige Abbildung bestimmen, werden in MappingSourceMappingSourceMappingSourceMappingSourcemappingSource und MappingDestMappingDestMappingDestMappingDestmappingDest übergeben. Die Indizes der Bilder beginnen ab 1. In obigem Beispiel ist also MappingSourceMappingSourceMappingSourceMappingSourcemappingSource = [1,1,1,2,2,3] und MappingDestMappingDestMappingDestMappingDestmappingDest = [2,3,4,3,4,4] zu verwenden. Die Gesamtanzahl von Bildern, aus denen das Mosaik besteht, wird in NumImagesNumImagesNumImagesNumImagesnumImages übergeben. Sie wird verwendet, um zu überprüfen, ob jedes Bild über eine Kette von Abbildungen erreicht werden kann. Der Index des Referenzbildes wird in ReferenceImageReferenceImageReferenceImageReferenceImagereferenceImage übergeben. Dieses Bild erhält in der Ausgabe als Abbildung die Einheitsmatrix.

Die zu den Bildpaaren gehörigen 3×3 projektiven Transformationsmatrizen werden in HomMatrices2DHomMatrices2DHomMatrices2DHomMatrices2DhomMatrices2D übergeben. Zusätzlich müssen in Rows1Rows1Rows1Rows1rows1, Cols1Cols1Cols1Cols1cols1, Rows2Rows2Rows2Rows2rows2 und Cols2Cols2Cols2Cols2cols2 die Koordinaten der zugeordneten Punktpaare in den einzelnen Bildpaaren übergeben werden. Sie können aus der Ausgabe von proj_match_points_ransacproj_match_points_ransacProjMatchPointsRansacProjMatchPointsRansacProjMatchPointsRansac mit tuple_selecttuple_selectTupleSelectTupleSelectTupleSelect oder mit der HDevelop-Funktion subset bestimmt werden. Damit bundle_adjust_mosaicbundle_adjust_mosaicBundleAdjustMosaicBundleAdjustMosaicBundleAdjustMosaic bestimmen kann, zu welcher Abbildung ein Punktpaar gehört, muss in NumCorrespondencesNumCorrespondencesNumCorrespondencesNumCorrespondencesnumCorrespondences für jedes Bildpaar die Anzahl der gefundenen Zuordnungen übergeben werden.

Der Paramteter TransformationTransformationTransformationTransformationtransformation bestimmt die Klasse der Transformationen, die zur Berechnung der Bündelausgleichung für die Transformationen der Bilder verwendet werden. Dies kann verwendet werden, um die zulässigen Transformationen einzuschränken. Für TransformationTransformationTransformationTransformationtransformation = 'projective'"projective""projective""projective""projective" werden projektive Abbildungen verwendet (siehe vector_to_proj_hom_mat2dvector_to_proj_hom_mat2dVectorToProjHomMat2dVectorToProjHomMat2dVectorToProjHomMat2d). Für TransformationTransformationTransformationTransformationtransformation = 'affine'"affine""affine""affine""affine" werden affine Abbildungen verwendet (siehe vector_to_hom_mat2dvector_to_hom_mat2dVectorToHomMat2dVectorToHomMat2dVectorToHomMat2d), für TransformationTransformationTransformationTransformationtransformation = 'similarity'"similarity""similarity""similarity""similarity" ähnlichkeitsabbildungen (siehe vector_to_similarityvector_to_similarityVectorToSimilarityVectorToSimilarityVectorToSimilarity) und für TransformationTransformationTransformationTransformationtransformation = 'rigid'"rigid""rigid""rigid""rigid" starre Abbildungen (siehe vector_to_rigidvector_to_rigidVectorToRigidVectorToRigidVectorToRigid).

Die berechneten Transformationsmatrizen werden als ein Array von 3×3 projektiven Transformationsmatrizen in MosaicMatrices2DMosaicMatrices2DMosaicMatrices2DMosaicMatrices2DmosaicMatrices2D zurückgegeben. Zusätzlich werden in (RowsRowsRowsRowsrows, ColsColsColsColscols) die durch die Bündelausgleichung rekonstruierten Punkte zurückgegeben. Der mittlere Projektionsfehler der rekonstruierten Punkte wird in ErrorErrorErrorErrorerror zurückgegeben. Dies kann verwendet werden, um zu überprüfen, ob die Optimierung zu sinnvollen Werten konvergiert ist.

Ausführungsinformationen

Parameter

NumImagesNumImagesNumImagesNumImagesnumImages (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Anzahl der verschiedenen Bilder, die zur Kalibrierung verwendet werden.

Restriktion: NumImages >= 2

ReferenceImageReferenceImageReferenceImageReferenceImagereferenceImage (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Index des Referenzbildes.

MappingSourceMappingSourceMappingSourceMappingSourcemappingSource (input_control)  integer-array HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indizes der Ausgangsbilder der Transformationen.

MappingDestMappingDestMappingDestMappingDestmappingDest (input_control)  integer-array HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indizes der Zielbilder der Transformationen.

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

Array von 3×3 projektiven Transformationsmatrizen.

Rows1Rows1Rows1Rows1rows1 (input_control)  point.x-array HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Zeilenkoordinaten korrespondierender Punkte in den jeweiligen Ausgangsbildern.

Cols1Cols1Cols1Cols1cols1 (input_control)  point.y-array HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Spaltenkoordinaten korrespondierender Punkte in den jeweiligen Ausgangsbildern.

Rows2Rows2Rows2Rows2rows2 (input_control)  point.x-array HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Zeilenkoordinaten korrespondierender Punkte in den jeweiligen Zielbildern.

Cols2Cols2Cols2Cols2cols2 (input_control)  point.y-array HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Spaltenkoordinaten korrespondierender Punkte in den jeweiligen Zielbildern.

NumCorrespondencesNumCorrespondencesNumCorrespondencesNumCorrespondencesnumCorrespondences (input_control)  integer-array HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Anzahl der Punktkorrespondenzen im jeweiligen Bildpaar.

TransformationTransformationTransformationTransformationtransformation (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Verwendete Transformationsklasse.

Defaultwert: 'projective' "projective" "projective" "projective" "projective"

Werteliste: 'affine'"affine""affine""affine""affine", 'projective'"projective""projective""projective""projective", 'rigid'"rigid""rigid""rigid""rigid", 'similarity'"similarity""similarity""similarity""similarity"

MosaicMatrices2DMosaicMatrices2DMosaicMatrices2DMosaicMatrices2DmosaicMatrices2D (output_control)  hom_mat2d-array HHomMat2D, HTupleHTupleHtuple (real) (double) (double) (double)

Array von 3×3 projektiven Transformationsmatrizen, die die Lage der Bilder im Mosaik bestimmen.

RowsRowsRowsRowsrows (output_control)  point.x-array HTupleHTupleHtuple (real) (double) (double) (double)

Zeilenkoordinaten der durch die Bündelausgleichung rekonstruierten Punkte.

ColsColsColsColscols (output_control)  point.y-array HTupleHTupleHtuple (real) (double) (double) (double)

Spaltenkoordinaten der durch die Bündelausgleichung rekonstruierten Punkte.

ErrorErrorErrorErrorerror (output_control)  real(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Durchschnittlicher Fehler pro rekonstruiertem Punkt.

Beispiel (HDevelop)

* Assume that Images contains the four images of the mosaic in the
* layout given in the above description.  Then the following example
* computes the bundle-adjusted transformation matrices.
From := [1,1,1,2,2,3]
To := [2,3,4,3,4,4]
HomMatrices2D := []
Rows1 := []
Cols1 := []
Rows2 := []
Cols2 := []
NumMatches := []
for J := 0 to |From|-1 by 1
    select_obj (Images, ImageF, From[J])
    select_obj (Images, ImageT, To[J])
    points_foerstner (ImageF, 1, 2, 3, 100, 0.1, 'gauss', 'true', \
                      RowsF, ColsF, _, _, _, _, _, _, _, _)
    points_foerstner (ImageT, 1, 2, 3, 100, 0.1, 'gauss', 'true', \
                      RowsT, ColsT, _, _, _, _, _, _, _, _)
    proj_match_points_ransac (ImageF, ImageT, RowsF, ColsF, RowsT, ColsT, \
                              'ncc', 10, 0, 0, 480, 640, 0, 0.5, \
                              'gold_standard', 2, 42, HomMat2D, \
                              Points1, Points2)
    HomMatrices2D := [HomMatrices2D,HomMat2D]
    Rows1 := [Rows1,subset(RowsF,Points1)]
    Cols1 := [Cols1,subset(ColsF,Points1)]
    Rows2 := [Rows2,subset(RowsT,Points2)]
    Cols2 := [Cols2,subset(ColsT,Points2)]
    NumMatches := [NumMatches,|Points1|]
endfor
bundle_adjust_mosaic (4, 1, From, To, HomMatrices2D, Rows1, Cols1, \
                      Rows2, Cols2, NumMatches, 'rigid', MosaicMatrices, \
                      Rows, Columns, Error)
gen_bundle_adjusted_mosaic (Images, MosaicImage, HomMatrices2D, \
                            'default', 'false', TransMat2D)

Ergebnis

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

Vorgänger

proj_match_points_ransacproj_match_points_ransacProjMatchPointsRansacProjMatchPointsRansacProjMatchPointsRansac, proj_match_points_ransac_guidedproj_match_points_ransac_guidedProjMatchPointsRansacGuidedProjMatchPointsRansacGuidedProjMatchPointsRansacGuided

Nachfolger

gen_bundle_adjusted_mosaicgen_bundle_adjusted_mosaicGenBundleAdjustedMosaicGenBundleAdjustedMosaicGenBundleAdjustedMosaic

Siehe auch

gen_projective_mosaicgen_projective_mosaicGenProjectiveMosaicGenProjectiveMosaicGenProjectiveMosaic

Modul

Matching