bundle_adjust_mosaicT_bundle_adjust_mosaicBundleAdjustMosaicBundleAdjustMosaicbundle_adjust_mosaic (Operator)

Name

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

def bundle_adjust_mosaic(num_images: int, reference_image: int, mapping_source: Sequence[int], mapping_dest: Sequence[int], hom_matrices_2d: Sequence[float], rows_1: Sequence[Union[float, int]], cols_1: Sequence[Union[float, int]], rows_2: Sequence[Union[float, int]], cols_2: Sequence[Union[float, int]], num_correspondences: Sequence[int], transformation: str) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

def bundle_adjust_mosaic_s(num_images: int, reference_image: int, mapping_source: Sequence[int], mapping_dest: Sequence[int], hom_matrices_2d: Sequence[float], rows_1: Sequence[Union[float, int]], cols_1: Sequence[Union[float, int]], rows_2: Sequence[Union[float, int]], cols_2: Sequence[Union[float, int]], num_correspondences: Sequence[int], transformation: str) -> Tuple[Sequence[float], Sequence[float], Sequence[float], float]

Beschreibung

bundle_adjust_mosaicbundle_adjust_mosaicBundleAdjustMosaicBundleAdjustMosaicBundleAdjustMosaicbundle_adjust_mosaic 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_ransacProjMatchPointsRansacProjMatchPointsRansacProjMatchPointsRansacproj_match_points_ransac 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 MappingSourceMappingSourceMappingSourceMappingSourcemappingSourcemapping_source und MappingDestMappingDestMappingDestMappingDestmappingDestmapping_dest übergeben. Die Indizes der Bilder beginnen ab 1. In obigem Beispiel ist also MappingSourceMappingSourceMappingSourceMappingSourcemappingSourcemapping_source = [1,1,1,2,2,3] und MappingDestMappingDestMappingDestMappingDestmappingDestmapping_dest = [2,3,4,3,4,4] zu verwenden. Die Gesamtanzahl von Bildern, aus denen das Mosaik besteht, wird in NumImagesNumImagesNumImagesNumImagesnumImagesnum_images ü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 ReferenceImageReferenceImageReferenceImageReferenceImagereferenceImagereference_image übergeben. Dieses Bild erhält in der Ausgabe als Abbildung die Einheitsmatrix.

Die zu den Bildpaaren gehörigen 3×3 projektiven Transformationsmatrizen werden in HomMatrices2DHomMatrices2DHomMatrices2DHomMatrices2DhomMatrices2Dhom_matrices_2d übergeben. Zusätzlich müssen in Rows1Rows1Rows1Rows1rows1rows_1, Cols1Cols1Cols1Cols1cols1cols_1, Rows2Rows2Rows2Rows2rows2rows_2 und Cols2Cols2Cols2Cols2cols2cols_2 die Koordinaten der zugeordneten Punktpaare in den einzelnen Bildpaaren übergeben werden. Sie können aus der Ausgabe von proj_match_points_ransacproj_match_points_ransacProjMatchPointsRansacProjMatchPointsRansacProjMatchPointsRansacproj_match_points_ransac mit tuple_selecttuple_selectTupleSelectTupleSelectTupleSelecttuple_select oder mit der HDevelop-Funktion subset bestimmt werden. Damit bundle_adjust_mosaicbundle_adjust_mosaicBundleAdjustMosaicBundleAdjustMosaicBundleAdjustMosaicbundle_adjust_mosaic bestimmen kann, zu welcher Abbildung ein Punktpaar gehört, muss in NumCorrespondencesNumCorrespondencesNumCorrespondencesNumCorrespondencesnumCorrespondencesnum_correspondences für jedes Bildpaar die Anzahl der gefundenen Zuordnungen übergeben werden.

Der Parameter TransformationTransformationTransformationTransformationtransformationtransformation 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 TransformationTransformationTransformationTransformationtransformationtransformation = 'projective'"projective""projective""projective""projective""projective" werden projektive Abbildungen verwendet (siehe vector_to_proj_hom_mat2dvector_to_proj_hom_mat2dVectorToProjHomMat2dVectorToProjHomMat2dVectorToProjHomMat2dvector_to_proj_hom_mat2d). Für TransformationTransformationTransformationTransformationtransformationtransformation = 'affine'"affine""affine""affine""affine""affine" werden affine Abbildungen verwendet (siehe vector_to_hom_mat2dvector_to_hom_mat2dVectorToHomMat2dVectorToHomMat2dVectorToHomMat2dvector_to_hom_mat2d), für TransformationTransformationTransformationTransformationtransformationtransformation = 'similarity'"similarity""similarity""similarity""similarity""similarity" Ähnlichkeitsabbildungen (siehe vector_to_similarityvector_to_similarityVectorToSimilarityVectorToSimilarityVectorToSimilarityvector_to_similarity) und für TransformationTransformationTransformationTransformationtransformationtransformation = 'rigid'"rigid""rigid""rigid""rigid""rigid" starre Abbildungen (siehe vector_to_rigidvector_to_rigidVectorToRigidVectorToRigidVectorToRigidvector_to_rigid).

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

Ausführungsinformationen

Parameter

NumImagesNumImagesNumImagesNumImagesnumImagesnum_images (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Anzahl der verschiedenen Bilder, die zur Kalibrierung verwendet werden.

Restriktion: NumImages >= 2

ReferenceImageReferenceImageReferenceImageReferenceImagereferenceImagereference_image (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Index des Referenzbildes.

MappingSourceMappingSourceMappingSourceMappingSourcemappingSourcemapping_source (input_control)  integer-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indizes der Ausgangsbilder der Transformationen.

MappingDestMappingDestMappingDestMappingDestmappingDestmapping_dest (input_control)  integer-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indizes der Zielbilder der Transformationen.

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

Array von 3×3 projektiven Transformationsmatrizen.

Rows1Rows1Rows1Rows1rows1rows_1 (input_control)  point.x-array HTupleSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Zeilenkoordinaten korrespondierender Punkte in den jeweiligen Ausgangsbildern.

Cols1Cols1Cols1Cols1cols1cols_1 (input_control)  point.y-array HTupleSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Spaltenkoordinaten korrespondierender Punkte in den jeweiligen Ausgangsbildern.

Rows2Rows2Rows2Rows2rows2rows_2 (input_control)  point.x-array HTupleSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Zeilenkoordinaten korrespondierender Punkte in den jeweiligen Zielbildern.

Cols2Cols2Cols2Cols2cols2cols_2 (input_control)  point.y-array HTupleSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Spaltenkoordinaten korrespondierender Punkte in den jeweiligen Zielbildern.

NumCorrespondencesNumCorrespondencesNumCorrespondencesNumCorrespondencesnumCorrespondencesnum_correspondences (input_control)  integer-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Anzahl der Punktkorrespondenzen im jeweiligen Bildpaar.

TransformationTransformationTransformationTransformationtransformationtransformation (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Verwendete Transformationsklasse.

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

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

MosaicMatrices2DMosaicMatrices2DMosaicMatrices2DMosaicMatrices2DmosaicMatrices2Dmosaic_matrices_2d (output_control)  hom_mat2d-array HHomMat2D, HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

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

RowsRowsRowsRowsrowsrows (output_control)  point.x-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Zeilenkoordinaten der durch die Bündelausgleichung rekonstruierten Punkte.

ColsColsColsColscolscols (output_control)  point.y-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Spaltenkoordinaten der durch die Bündelausgleichung rekonstruierten Punkte.

ErrorErrorErrorErrorerrorerror (output_control)  real(-array) HTupleSequence[float]HTupleHtuple (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_mosaicBundleAdjustMosaicBundleAdjustMosaicBundleAdjustMosaicbundle_adjust_mosaic den Wert 2 (H_MSG_TRUE). Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

proj_match_points_ransacproj_match_points_ransacProjMatchPointsRansacProjMatchPointsRansacProjMatchPointsRansacproj_match_points_ransac, proj_match_points_ransac_guidedproj_match_points_ransac_guidedProjMatchPointsRansacGuidedProjMatchPointsRansacGuidedProjMatchPointsRansacGuidedproj_match_points_ransac_guided

Nachfolger

gen_bundle_adjusted_mosaicgen_bundle_adjusted_mosaicGenBundleAdjustedMosaicGenBundleAdjustedMosaicGenBundleAdjustedMosaicgen_bundle_adjusted_mosaic

Siehe auch

gen_projective_mosaicgen_projective_mosaicGenProjectiveMosaicGenProjectiveMosaicGenProjectiveMosaicgen_projective_mosaic

Modul

Matching