Name
radial_distortion_self_calibration T_radial_distortion_self_calibration RadialDistortionSelfCalibration radial_distortion_self_calibration RadialDistortionSelfCalibration RadialDistortionSelfCalibration — Kalibrieren der radialen Verzeichnung.
Herror radial_distortion_self_calibration (Hobject Contours , Hobject* SelectedContours , const HTuple& Width , const HTuple& Height , const HTuple& InlierThreshold , const HTuple& RandSeed , const HTuple& DistortionModel , const HTuple& DistortionCenter , const HTuple& PrincipalPointVar , HTuple* CameraParam )
HXLDContArray HXLDContArray ::RadialDistortionSelfCalibration (const HTuple& Width , const HTuple& Height , const HTuple& InlierThreshold , const HTuple& RandSeed , const HTuple& DistortionModel , const HTuple& DistortionCenter , const HTuple& PrincipalPointVar , HTuple* CameraParam ) const
void RadialDistortionSelfCalibration (const HObject& Contours , HObject* SelectedContours , const HTuple& Width , const HTuple& Height , const HTuple& InlierThreshold , const HTuple& RandSeed , const HTuple& DistortionModel , const HTuple& DistortionCenter , const HTuple& PrincipalPointVar , HTuple* CameraParam )
HXLDCont HXLDCont ::RadialDistortionSelfCalibration (Hlong Width , Hlong Height , double InlierThreshold , Hlong RandSeed , const HString& DistortionModel , const HString& DistortionCenter , double PrincipalPointVar , HTuple* CameraParam ) const
HXLDCont HXLDCont ::RadialDistortionSelfCalibration (Hlong Width , Hlong Height , double InlierThreshold , Hlong RandSeed , const char* DistortionModel , const char* DistortionCenter , double PrincipalPointVar , HTuple* CameraParam ) const
void HOperatorSetX .RadialDistortionSelfCalibration ( [in] IHUntypedObjectX* Contours , [out] IHUntypedObjectX* * SelectedContours , [in] VARIANT Width , [in] VARIANT Height , [in] VARIANT InlierThreshold , [in] VARIANT RandSeed , [in] VARIANT DistortionModel , [in] VARIANT DistortionCenter , [in] VARIANT PrincipalPointVar , [out] VARIANT* CameraParam )
IHXLDContX* HXLDContX .RadialDistortionSelfCalibration ( [in] Hlong Width , [in] Hlong Height , [in] double InlierThreshold , [in] Hlong RandSeed , [in] BSTR DistortionModel , [in] BSTR DistortionCenter , [in] double PrincipalPointVar , [out] VARIANT* CameraParam )
static void HOperatorSet .RadialDistortionSelfCalibration (HObject contours , out HObject selectedContours , HTuple width , HTuple height , HTuple inlierThreshold , HTuple randSeed , HTuple distortionModel , HTuple distortionCenter , HTuple principalPointVar , out HTuple cameraParam )
HXLDCont HXLDCont .RadialDistortionSelfCalibration (int width , int height , double inlierThreshold , int randSeed , string distortionModel , string distortionCenter , double principalPointVar , out HTuple cameraParam )
radial_distortion_self_calibration radial_distortion_self_calibration RadialDistortionSelfCalibration radial_distortion_self_calibration RadialDistortionSelfCalibration RadialDistortionSelfCalibration berechnet die
Verzeichnungsparameter sowie das Verzeichnungszentrum einer Linse
basierend auf den in Contours Contours Contours Contours Contours contours übergebenen
XLD-Konturen. Ähnlich dem Operator camera_calibration camera_calibration CameraCalibration camera_calibration CameraCalibration CameraCalibration werden
die Verzeichnungswerte im Parameter CameraParam CameraParam CameraParam CameraParam CameraParam cameraParam
zurückgegeben. Indem man diesen Parameter an die Operatoren
change_radial_distortion_cam_par change_radial_distortion_cam_par ChangeRadialDistortionCamPar change_radial_distortion_cam_par ChangeRadialDistortionCamPar ChangeRadialDistortionCamPar und
change_radial_distortion_image change_radial_distortion_image ChangeRadialDistortionImage change_radial_distortion_image ChangeRadialDistortionImage ChangeRadialDistortionImage weiterreicht, kann man die
radiale Verzeichnung in Bildern korrigieren. Zusätzlich werden in
SelectedContours SelectedContours SelectedContours SelectedContours SelectedContours selectedContours die Konturen zurückgegeben, die zur
Kalibrierung verwendet wurden.
Beachten Sie jedoch, dass mit dem Operator keine 3D-Information in
der Szene bestimmt werden kann, da die Brennweite und die
Skalierungsfaktoren nicht bestimmt werden.
Das zur Kalibrierung verwendete Verzeichnungsmodell kann über
DistortionModel DistortionModel DistortionModel DistortionModel DistortionModel distortionModel gewählt werden. Beim Divisionsmodell
(DistortionModel DistortionModel DistortionModel DistortionModel DistortionModel distortionModel = 'division' "division" "division" "division" "division" "division" ) werden die Verzeichnungen
über den Verzeichnungsparameter
beschrieben (siehe
camera_calibration camera_calibration CameraCalibration camera_calibration CameraCalibration CameraCalibration ). Beim polynomiellen Modell
(DistortionModel DistortionModel DistortionModel DistortionModel DistortionModel distortionModel = 'polynomial' "polynomial" "polynomial" "polynomial" "polynomial" "polynomial" ) werden
die Verzeichnungen über die radialen Verzeichnungsparameter
und die tangentialen
Verzeichnungsparameter
beschrieben (siehe camera_calibration camera_calibration CameraCalibration camera_calibration CameraCalibration CameraCalibration ).
Das Zentrum der Verzeichnungen
wird als Hauptpunkt angenommen. Für
DistortionModel DistortionModel DistortionModel DistortionModel DistortionModel distortionModel = 'division' "division" "division" "division" "division" "division" enthält CameraParam CameraParam CameraParam CameraParam CameraParam cameraParam
die Werte für
. Für
DistortionModel DistortionModel DistortionModel DistortionModel DistortionModel distortionModel = 'polynomial' "polynomial" "polynomial" "polynomial" "polynomial" "polynomial" enthält
CameraParam CameraParam CameraParam CameraParam CameraParam cameraParam die Werte für
. Da die Kalibrierung ohne einen
Kalibrierkörper durchgeführt wird, können die Brennweite f und die
Skalierungsfaktoren
nicht bestimmt
werden und werden daher auf 0 beziehungsweise 1 gesetzt.
Die Bestimmung der Verzeichnung basiert auf der Annahme, dass in der
aufgenommen Szene eine signifikante Anzahl von geraden Kanten oder
Linien vorhanden ist. Durch die Linsenverzeichnung werden
diese Geraden auf gekrümmte Linien abgebildet. Es werden nun
geeignete Parameter gesucht, die diese gekrümmten Linien wieder auf
Geraden abbilden, und somit also die Verzeichnung kompensieren.
In der Anwendung bestimmt man mit einem Kanten- oder Linienextraktor
(z.B. edges_sub_pix edges_sub_pix EdgesSubPix edges_sub_pix EdgesSubPix EdgesSubPix oder lines_gauss lines_gauss LinesGauss lines_gauss LinesGauss LinesGauss ) die Konturen
im Bild. Die Konturen sollten im Bild gleichverteilt und möglichst
in der Nähe des Bildrands liegen, da sich dort die Verzeichnung am
stärksten auswirkt und damit die Kalibrierung am stabilsten
wird. Zur Verbesserung von Laufzeit oder Robustheit können die
Konturen auch vorverarbeitet werden (z.B. mit
segment_contours_xld segment_contours_xld SegmentContoursXld segment_contours_xld SegmentContoursXld SegmentContoursXld , union_collinear_contours_xld union_collinear_contours_xld UnionCollinearContoursXld union_collinear_contours_xld UnionCollinearContoursXld UnionCollinearContoursXld ,
union_cocircular_contours_xld union_cocircular_contours_xld UnionCocircularContoursXld union_cocircular_contours_xld UnionCocircularContoursXld UnionCocircularContoursXld oder
select_shape_xld select_shape_xld SelectShapeXld select_shape_xld SelectShapeXld SelectShapeXld ), um möglichst lange gerade oder
kreisförmige Segmente zu erhalten. Falls in einem Bild nicht
ausreichend viele gerade Konturen in der Szene vorhanden sind,
können auch die Konturen aus mehreren Bildern übergeben werden
(concat_obj concat_obj ConcatObj concat_obj ConcatObj ConcatObj ).
Der Operator bestimmt automatisch über ein robustes RANSAC-Verfahren
jene Konturen aus Contours Contours Contours Contours Contours contours , die das Abbild von Raumgeraden
sind. Die Konturen, die diese Forderung nicht erfüllen und somit
für den Kalibrierprozess ungeeignet sind, werden als Ausreißer
bezeichnet. Der Operator geht von einer maximalen Ausreißerquote
von 50 Prozent aus. Eine Kontur wird als Ausreißer klassifiziert,
falls die mittlere Abweichung der Kontur von einer Geraden nach der
Verzeichnungskorrektur den maximalen Schwellwert T überschreitet:
Der Wert InlierThreshold InlierThreshold InlierThreshold InlierThreshold InlierThreshold inlierThreshold beschreibt die mittlere Abweichung
der Kontur von einer Geraden in Pixeln bei einer Kontur mit 100
Konturpunkten. Der eigentliche Schwellwert T entsteht durch die
Skalierung von InlierThreshold InlierThreshold InlierThreshold InlierThreshold InlierThreshold inlierThreshold mit der Referenzlänge (100)
und der Konturpunktzahl m, um bei geometrisch ähnlichen Konturen
die gleiche Kontur-Klassifizierung zu erreichen. Die typischen
Werte für InlierThreshold InlierThreshold InlierThreshold InlierThreshold InlierThreshold inlierThreshold liegen zwischen 0.05 und 0.5. Je
höher der Wert, desto mehr Abweichungen werden toleriert. Wird für
InlierThreshold InlierThreshold InlierThreshold InlierThreshold InlierThreshold inlierThreshold der Wert 0 eingegeben, werden sämtliche
Konturen Contours Contours Contours Contours Contours contours zur Kalibrierung verwendet. Die
RANSAC-Konturauswahl wird dadurch unterdrückt, so dass eine manuelle
Auswahl der Konturen möglich ist. Dies ist beispielsweise dann
hilfreich, wenn die Ausreißerquote über 50 Prozent liegt.
Mit dem Parameter RandSeed RandSeed RandSeed RandSeed RandSeed randSeed kann das randomisierte Verhalten
des RANSAC-Verfahrens beeinflusst werden, um reproduzierbare
Ergebnisse zu erhalten. Wird RandSeed RandSeed RandSeed RandSeed RandSeed randSeed auf einen positiven
Wert gesetzt, so liefert der Operator bei jedem Aufruf mit denselben
Parametern auch dasselbe Resultat, da der intern verwendete
Zufallsgenerator mit RandSeed RandSeed RandSeed RandSeed RandSeed randSeed initialisiert wird.
Zur Bestimmung der Verzeichnungsparameter
beziehungsweise
stehen die Methoden 'variable' "variable" "variable" "variable" "variable" "variable" ,
'adaptive' "adaptive" "adaptive" "adaptive" "adaptive" "adaptive" und 'fixed' "fixed" "fixed" "fixed" "fixed" "fixed" zur Verfügung, die unter
DistortionCenter DistortionCenter DistortionCenter DistortionCenter DistortionCenter distortionCenter festgelegt werden.
Bei der Vorauswahl 'variable' "variable" "variable" "variable" "variable" "variable" wird von Beginn an mit
variablen Verzeichnungszentrum c kalibriert. Hierbei sollten
viele gleichmäßig verteilte Konturen in der Nähe des Bildrandes
vorliegen oder die Verzeichnung möglichst stark sein, da ansonsten
das Verzeichnungszentrum nicht bestimmt werden kann und dies zur
Instabilität führt. Bei der Variante 'adaptive' "adaptive" "adaptive" "adaptive" "adaptive" "adaptive" wird
zunächst das Verzeichnungszentrum c fest in der Bildmitte
angenommen und die Ausreißer mit dem Schwellwert
InlierThreshold InlierThreshold InlierThreshold InlierThreshold InlierThreshold inlierThreshold eliminiert. In einem letzten Schritt wird
dann eine Kalibrierung mit allen Verzeichnungsparametern
beziehungsweise
durchgeführt, die dann angenommen wird,
falls
als eine stabile
Lösung in der Nähe der Bildmitte gefunden wurde. Andernfalls wird
c in der Bildmitte angenommen. Diese Methode sollte dann
verwendet werden, wenn das Verzeichnungszentrum außerhalb der
Bildmitte gesucht werden soll, jedoch wenige Konturen zur Verfügung
stehen oder die Lage der Konturen ungünstig ist (Bsp.: Konturen
verlaufen in gleiche Richtung oder liegen im selben Bildbereich).
Bei 'fixed' "fixed" "fixed" "fixed" "fixed" "fixed" wird schließlich das Verzeichnungszentrum als
konstant in der Bildmitte angenommen und nur
beziehungsweise
bestimmt.
Diese Methode sollte bei sehr schwachen Verzeichnungen
und wenigen Konturen in schlechter Lage angewendet werden.
Über den Parameter PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar principalPointVar kann bei den Methoden
'adaptive' "adaptive" "adaptive" "adaptive" "adaptive" "adaptive" und 'variable' "variable" "variable" "variable" "variable" "variable" schließlich die
Abweichung von c von der Bildmitte gesteuert werden. Falls die
Abweichung gesteuert werden soll, muss PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar principalPointVar
zwischen 1 und 100 liegen. Dabei gilt: Je höher der Wert, umso mehr
darf c von der Bildmitte abweichen. Liegt der Wert bei 0, findet
keine Steuerung statt, d.h. der Hauptpunkt wird alleine durch die
Konturen bestimmt. Generell sollte die Steuerung über
PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar principalPointVar bei schwachen Verzeichnungen und ähnlich
orientierten Konturen verwendet werden, da sonst unter Umständen
keine stabile Lösung gefunden wird.
Aufgrund des verwendeten Algorithmus ist die Laufzeit von
radial_distortion_self_calibration radial_distortion_self_calibration RadialDistortionSelfCalibration radial_distortion_self_calibration RadialDistortionSelfCalibration RadialDistortionSelfCalibration für
DistortionCenter DistortionCenter DistortionCenter DistortionCenter DistortionCenter distortionCenter = 'variable' "variable" "variable" "variable" "variable" "variable" und
PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar principalPointVar = 0 am geringsten. Die
Laufzeit für DistortionCenter DistortionCenter DistortionCenter DistortionCenter DistortionCenter distortionCenter = 'variable' "variable" "variable" "variable" "variable" "variable" und
PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar principalPointVar > 0 steigt mit kleineren
Werten von PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar principalPointVar signifikant an. Die
Laufzeiten für DistortionCenter DistortionCenter DistortionCenter DistortionCenter DistortionCenter distortionCenter = 'adaptive' "adaptive" "adaptive" "adaptive" "adaptive" "adaptive" und
DistortionCenter DistortionCenter DistortionCenter DistortionCenter DistortionCenter distortionCenter = 'fixed' "fixed" "fixed" "fixed" "fixed" "fixed" sind auch signifikant
höher als bei DistortionCenter DistortionCenter DistortionCenter DistortionCenter DistortionCenter distortionCenter = 'variable' "variable" "variable" "variable" "variable" "variable" und
PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar principalPointVar = 0 .
Da das polynomielle Modell
(DistortionModel DistortionModel DistortionModel DistortionModel DistortionModel distortionModel = 'polynomial' "polynomial" "polynomial" "polynomial" "polynomial" "polynomial" ) mehr Parameter enthält
als das Divisionsmodell (DistortionModel DistortionModel DistortionModel DistortionModel DistortionModel distortionModel = 'division' "division" "division" "division" "division" "division" ),
kann die Kalibrierung über das polynomielle Modell eine etwas geringere
Stabilität aufweisen als die Kalibrierung über das Divisionsmodell. Dies
macht sich besonders bei der Bestimmung der tangentialen
Verzeichnungskomponenten
bemerkbar. Die
Stabilität kann verbessert werden, indem man Konturen aus mehreren Bildern
verwendet. Zusätzliche Stabilität erhält man wie oben bereits erwähnt für
DistortionCenter DistortionCenter DistortionCenter DistortionCenter DistortionCenter distortionCenter = 'fixed' "fixed" "fixed" "fixed" "fixed" "fixed" ,
DistortionCenter DistortionCenter DistortionCenter DistortionCenter DistortionCenter distortionCenter = 'adaptive' "adaptive" "adaptive" "adaptive" "adaptive" "adaptive" oder
PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar PrincipalPointVar principalPointVar > 0 .
Multithreading-Typ: reentrant (läuft parallel zu nicht-exklusiven Operatoren).
Multithreading-Bereich: global (kann von jedem Thread aufgerufen werden).
Wird ohne Parallelisierung verarbeitet.
Konturen, die für die Kalibrierung zur
Verfügung stehen.
Konturen, die zur Kalibrierung verwendet wurden
Breite der Bilder, aus denen die Konturen
extrahiert wurden.
Defaultwert: 640
Wertevorschläge: 640, 768
Restriktion: Width > 0
Höhe der Bilder, aus denen die Konturen
extrahiert wurden.
Defaultwert: 480
Wertevorschläge: 480, 576
Restriktion: Height > 0
Schwellwert zur Klassifizierung von Ausreißern.
Defaultwert: 0.05
Wertevorschläge: 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1
Restriktion: InlierThreshold >= 0
Initialisierungswert für den Zufallszahlengenerator.
Defaultwert: 42
Legt das Verzeichnungsmodell fest.
Defaultwert:
'division'
"division"
"division"
"division"
"division"
"division"
Werteliste: 'division' "division" "division" "division" "division" "division" , 'polynomial' "polynomial" "polynomial" "polynomial" "polynomial" "polynomial"
Legt fest, wie das Verzeichnungszentrum
bestimmt wird.
Defaultwert:
'variable'
"variable"
"variable"
"variable"
"variable"
"variable"
Werteliste: 'adaptive' "adaptive" "adaptive" "adaptive" "adaptive" "adaptive" , 'fixed' "fixed" "fixed" "fixed" "fixed" "fixed" , 'variable' "variable" "variable" "variable" "variable" "variable"
Steuert die Abweichung des
Verzeichnungszentrums von der Bildmitte;
größere Werte erlauben größere Abweichungen; 0
schaltet den Strafterm ab.
Defaultwert: 0.0
Wertevorschläge: 0.0, 5.0, 10.0, 20.0, 50.0, 100.0
Restriktion: PrincipalPointVar >= 0.0 && PrincipalPointVar <= 100.0
Interne Kameraparameter.
Parameteranzahl: CameraParam == 8 || CameraParam == 12
* Assume that GrayImage is one image in gray values with a
* resolution of 640 x 480 and a suitable number of contours. Then
* the following example performs the calibration using these
* contours and corrects the image with the estimated distortion
* parameters.
edges_sub_pix (GrayImage, Edges, 'canny', 1.0, 20, 40)
segment_contours_xld (Edges, ContoursSplit, 'lines_circles', 5, 8, 4)
radial_distortion_self_calibration (ContoursSplit, SelectedContours, \
640, 480, 0.08, 42, 'division', \
'variable', 0, CameraParam)
get_domain (GrayImage, Domain)
change_radial_distortion_cam_par ('fullsize', CameraParam, 0, CamParamOut)
change_radial_distortion_image (GrayImage, Domain, ImageRectified, \
CameraParam, CamParamOut)
Sind die Parameterwerte korrekt, dann liefert
radial_distortion_self_calibration radial_distortion_self_calibration RadialDistortionSelfCalibration radial_distortion_self_calibration RadialDistortionSelfCalibration RadialDistortionSelfCalibration den Wert 2 (H_MSG_TRUE).
Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.
edges_sub_pix edges_sub_pix EdgesSubPix edges_sub_pix EdgesSubPix EdgesSubPix ,
segment_contours_xld segment_contours_xld SegmentContoursXld segment_contours_xld SegmentContoursXld SegmentContoursXld
change_radial_distortion_cam_par change_radial_distortion_cam_par ChangeRadialDistortionCamPar change_radial_distortion_cam_par ChangeRadialDistortionCamPar ChangeRadialDistortionCamPar ,
change_radial_distortion_image change_radial_distortion_image ChangeRadialDistortionImage change_radial_distortion_image ChangeRadialDistortionImage ChangeRadialDistortionImage
camera_calibration camera_calibration CameraCalibration camera_calibration CameraCalibration CameraCalibration
T. Thormälen, H. Broszio: „Automatic line-based estimation of
radial lens distortion“; in: Integrated Computer-Aided
Engineering; vol. 12; pp. 177-190; 2005.
Calibration