Name
gen_binocular_rectification_mapT_gen_binocular_rectification_mapGenBinocularRectificationMapgen_binocular_rectification_mapGenBinocularRectificationMapGenBinocularRectificationMap — Berechnet die Abbildung der beiden Bildebenen eines binokularen Stereosystems
in eine gemeinsame Bildebene.
gen_binocular_rectification_map( : Map1, Map2 : CamParam1, CamParam2, RelPose, SubSampling, Method, MapType : CamParamRect1, CamParamRect2, CamPoseRect1, CamPoseRect2, RelPoseRect)
Herror T_gen_binocular_rectification_map(Hobject* Map1, Hobject* Map2, const Htuple CamParam1, const Htuple CamParam2, const Htuple RelPose, const Htuple SubSampling, const Htuple Method, const Htuple MapType, Htuple* CamParamRect1, Htuple* CamParamRect2, Htuple* CamPoseRect1, Htuple* CamPoseRect2, Htuple* RelPoseRect)
Herror gen_binocular_rectification_map(Hobject* Map1, Hobject* Map2, const HTuple& CamParam1, const HTuple& CamParam2, const HTuple& RelPose, const HTuple& SubSampling, const HTuple& Method, const HTuple& MapType, HTuple* CamParamRect1, HTuple* CamParamRect2, HTuple* CamPoseRect1, HTuple* CamPoseRect2, HTuple* RelPoseRect)
HImage HImage::GenBinocularRectificationMap(HImage* Map2, const HTuple& CamParam1, const HTuple& CamParam2, const HTuple& RelPose, const HTuple& SubSampling, const HTuple& Method, const HTuple& MapType, HTuple* CamParamRect1, HTuple* CamParamRect2, HTuple* CamPoseRect1, HTuple* CamPoseRect2, HTuple* RelPoseRect)
void GenBinocularRectificationMap(HObject* Map1, HObject* Map2, const HTuple& CamParam1, const HTuple& CamParam2, const HTuple& RelPose, const HTuple& SubSampling, const HTuple& Method, const HTuple& MapType, HTuple* CamParamRect1, HTuple* CamParamRect2, HTuple* CamPoseRect1, HTuple* CamPoseRect2, HTuple* RelPoseRect)
HImage HImage::GenBinocularRectificationMap(const HTuple& CamParam1, const HTuple& CamParam2, const HPose& RelPose, double SubSampling, const HString& Method, const HString& MapType, HTuple* CamParamRect1, HTuple* CamParamRect2, HPose* CamPoseRect1, HPose* CamPoseRect2, HPose* RelPoseRect)
HImage HImage::GenBinocularRectificationMap(const HTuple& CamParam1, const HTuple& CamParam2, const HPose& RelPose, double SubSampling, const char* Method, const char* MapType, HTuple* CamParamRect1, HTuple* CamParamRect2, HPose* CamPoseRect1, HPose* CamPoseRect2, HPose* RelPoseRect)
HImage HPose::GenBinocularRectificationMap(HImage* Map2, const HTuple& CamParam1, const HTuple& CamParam2, double SubSampling, const HString& Method, const HString& MapType, HTuple* CamParamRect1, HTuple* CamParamRect2, HPose* CamPoseRect1, HPose* CamPoseRect2, HPose* RelPoseRect) const
HImage HPose::GenBinocularRectificationMap(HImage* Map2, const HTuple& CamParam1, const HTuple& CamParam2, double SubSampling, const char* Method, const char* MapType, HTuple* CamParamRect1, HTuple* CamParamRect2, HPose* CamPoseRect1, HPose* CamPoseRect2, HPose* RelPoseRect) const
void HOperatorSetX.GenBinocularRectificationMap(
[out] IHUntypedObjectX** Map1, [out] IHUntypedObjectX** Map2, [in] VARIANT CamParam1, [in] VARIANT CamParam2, [in] VARIANT RelPose, [in] VARIANT SubSampling, [in] VARIANT Method, [in] VARIANT MapType, [out] VARIANT* CamParamRect1, [out] VARIANT* CamParamRect2, [out] VARIANT* CamPoseRect1, [out] VARIANT* CamPoseRect2, [out] VARIANT* RelPoseRect)
IHImageX* HImageX.GenBinocularRectificationMap(
[in] VARIANT CamParam1, [in] VARIANT CamParam2, [in] VARIANT RelPose, [in] double SubSampling, [in] BSTR Method, [in] BSTR MapType, [out] VARIANT* CamParamRect1, [out] VARIANT* CamParamRect2, [out] VARIANT* CamPoseRect1, [out] VARIANT* CamPoseRect2, [out] VARIANT* RelPoseRect)
IHImageX* HPoseX.GenBinocularRectificationMap(
[out] IHImageX** Map2, [in] VARIANT CamParam1, [in] VARIANT CamParam2, [in] VARIANT RelPose, [in] double SubSampling, [in] BSTR Method, [in] BSTR MapType, [out] VARIANT* CamParamRect1, [out] VARIANT* CamParamRect2, [out] VARIANT* CamPoseRect1, [out] VARIANT* CamPoseRect2, [out] VARIANT* RelPoseRect)
static void HOperatorSet.GenBinocularRectificationMap(out HObject map1, out HObject map2, HTuple camParam1, HTuple camParam2, HTuple relPose, HTuple subSampling, HTuple method, HTuple mapType, out HTuple camParamRect1, out HTuple camParamRect2, out HTuple camPoseRect1, out HTuple camPoseRect2, out HTuple relPoseRect)
HImage HImage.GenBinocularRectificationMap(HTuple camParam1, HTuple camParam2, HPose relPose, double subSampling, string method, string mapType, out HTuple camParamRect1, out HTuple camParamRect2, out HPose camPoseRect1, out HPose camPoseRect2, out HPose relPoseRect)
HImage HPose.GenBinocularRectificationMap(out HImage map2, HTuple camParam1, HTuple camParam2, double subSampling, string method, string mapType, out HTuple camParamRect1, out HTuple camParamRect2, out HPose camPoseRect1, out HPose camPoseRect2, out HPose relPoseRect)
Stereobildpaare werden rektifiziert, indem eine Transformationsvorschrift
für jede Bildebene bestimmt wird, so dass Paare von
korrespondierenden Epipolarlinien kollinear sind und parallel zur
X-Achse des Bildkoordinatensystems verlaufen. Man kann sich die
rektifizierten Bilder vorstellen, als würden sie von einem neuen
Stereoaufbau aufgenommen, welchen man durch eine Rotation (und Translation
bei telezentrischen Kameras) der ursprünglichen Kameras erhalten würde.
Die optischen Zentren (bzw. bei telezentrischen Kameras die Richtung der
optischen Achse) werden beibehalten. Bei perspektivischen Kameras
werden zusätzlich die Bildebenen in eine gemeinsame Ebene transformiert.
Letzteres ist gleichbedeutend mit der Gleichsetzung der Bildweiten und der
Gleichrichtung der optischen Achsen.
Um die Abbildungsvorschrift für rektifizierte Bilder zu erhalten verlangt
gen_binocular_rectification_mapgen_binocular_rectification_mapGenBinocularRectificationMapgen_binocular_rectification_mapGenBinocularRectificationMapGenBinocularRectificationMap die internen Kameraparameter
CamParam1CamParam1CamParam1CamParam1CamParam1camParam1 von Kamera 1 und CamParam2CamParam2CamParam2CamParam2CamParam2camParam2 von Kamera 2.
Ebenso wird die relative Lage RelPoseRelPoseRelPoseRelPoseRelPoserelPose des
Kamerasystems 2 bezüglich des Kamerasystems 1 benötigt. Die Werte für diese
Parameter kann man beispielsweise vom Operator
calibrate_camerascalibrate_camerasCalibrateCamerascalibrate_camerasCalibrateCamerasCalibrateCameras erhalten.
Die für die Rektifizierung modifizierten internen Kameraparameter werden
in CamParamRect1CamParamRect1CamParamRect1CamParamRect1CamParamRect1camParamRect1 und CamParamRect2CamParamRect2CamParamRect2CamParamRect2CamParamRect2camParamRect2 ausgegeben.
Die Rotation (und bei telezentrischen Kameras die Translation) des entzerrten
Kamerasystems bezüglich des ursprünglichen Systems wird durch eine
Punkttransformation vom entzerrten System ins originale System in
CamPoseRect1CamPoseRect1CamPoseRect1CamPoseRect1CamPoseRect1camPoseRect1 und CamPoseRect2CamPoseRect2CamPoseRect2CamPoseRect2CamPoseRect2camPoseRect2 zurückgegeben. Schließlich
gibt RelPoseRectRelPoseRectRelPoseRectRelPoseRectRelPoseRectrelPoseRect die relative Lage der entzerrten Kamerasysteme
durch eine Punkttransformation von der entzerrten Kamera 2 zur entzerrten
Kamera 1 an.
Bei perspektivischen Kameras ist dies lediglich
eine Verschiebung in der x Richtung. Im Allgemeinen
werden die Abbildungsvorschriften so festgelegt, dass sich das
entzerrte Kamerasystem 1 links von dem entzerrten Kamerasystem 2
befindet. Dies bedeutet, dass das optische Zentrum der entzerrten
Kamera 2 eine positive X-Koordinate im entzerrten Koordinatensystem
von Kamera 1 besitzt.
Die Projektion auf eine gemeinsame Ebene hat mehrere Freiheitsgrade,
welche implizit durch die Auswahl einer bestimmten Methode in
MethodMethodMethodMethodMethodmethod bestimmt werden können (momentan steht nur ein
Parameterwert zur Verfügung):
-
'geometric'"geometric""geometric""geometric""geometric""geometric" legt die Orientierung der gemeinsamen
Bildebene durch das Kreuzprodukt der Richtungen der Basisgeraden
und der Schnittgeraden der ursprünglichen Bildebenen fest. Die
neue Bildweite wird so bestimmt, dass die alten Bildhauptpunkte
von der neuen Bildebene gleichen Abstand haben.
Bei telezentrischen Kameras wird der Parameter MethodMethodMethodMethodMethodmethod ignoriert.
Die relative Lage beider Kameras ist in einem solchen Aufbau nicht
eindeutig bestimmt, da die Kameras entlang ihrer optischen Achse verschoben
die gleichen Aufnahmen liefern. Um trotzdem eine absolute Distanzmessung
zur Kamera zu ermöglichen, wird intern angenommen, dass die Kameras einen
festen Abstand und Orientierung zueinander haben. Hierfür werden sie entlang
ihrer optischen Achse derart verschoben, dass ihr Abstand ein Meter beträgt
und die Gerade auf der beide Kameras liegen (Basis) die optischen
Achsen beider Kameras im gleichen Winkel schneiden (Die Basis und die
optischen Achsen bilden ein gleichschenkliges Dreieck). Die optischen Achsen
bleiben dabei erhalten. Die relative Lage der rektifizierten Kameras
RelPoseRectRelPoseRectRelPoseRectRelPoseRectRelPoseRectrelPoseRect kann sich von der relativen Lage der ursprünglichen
Kameras RelPoseRelPoseRelPoseRelPoseRelPoserelPose dadurch stark unterscheiden.
Die Abbildungsvorschriften für die Bilder von Kamera 1 und Kamera 2
werden in Map1Map1Map1Map1Map1map1 und Map2Map2Map2Map2Map2map2 in Form von
Bildmatritzen zurückgegeben.
Der Parameter MapTypeMapTypeMapTypeMapTypeMapTypemapType gibt an, in welchem Typ die
Abbildungsvorschrift gespeichert werden sollen. Wurde
'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor" gewählt, so bestehen beide
Abbildungsvorschriften aus einem Bild mit einem
Kanal, in dem für jedes Pixel des Ergebnisbildes die linearen Koordinaten
desjenigen Pixels des Eingabebildes stehen, welches den transformierten
Koordinaten am nächsten liegt. Wurde die bilineare Interpolation
('bilinear'"bilinear""bilinear""bilinear""bilinear""bilinear") gewählt, so bestehen beide Abbildungsvorschriften
aus einem Bild mit fünf Kanälen. Der erste Kanal enthält für jedes Pixel des
Ergebnisbildes die linearen Koordinaten desjenigen Pixels des Eingabebildes,
welches links oberhalb von den transformierten Koordinaten liegt.
Die übrigen vier Kanäle enthalten die
Gewichte der einzelnen vier Nachbarpixel der transformierten
Koordinaten für die bilineare Interpolation in folgender Reihenfolge:
Der zweite Kanal z.B. enthält die Gewichte der Pixel, die links oberhalb
der transformierten Koordinaten liegen. Wurde 'coord_map_sub_pix'"coord_map_sub_pix""coord_map_sub_pix""coord_map_sub_pix""coord_map_sub_pix""coord_map_sub_pix"
gewählt, bestehen beide Abbildungsvorschriften aus einem Vektorfeld,
welches für jedes Pixel des Ergebnisbildes die subpixelgenauen Koordinaten
im Eingabebild enthält.
Die Größe und Auflösung der Abbildungen und
transformierten Bilder kann mit dem Parameter SubSamplingSubSamplingSubSamplingSubSamplingSubSamplingsubSampling
bestimmt werden, welcher einen Abtastfaktor auf die Originalbilder
beschreibt.
Wenn die erzeugte Abbildung in einem anderen Programm wiederverwendet werden
soll, kann man sie mit dem Operator write_imagewrite_imageWriteImagewrite_imageWriteImageWriteImage als Mehrkanalbild
abgespeichern (Format: 'tiff'"tiff""tiff""tiff""tiff""tiff").
- Multithreading-Typ: reentrant (läuft parallel zu nicht-exklusiven Operatoren).
- Multithreading-Bereich: global (kann von jedem Thread aufgerufen werden).
- Wird ohne Parallelisierung verarbeitet.
Abbildungsvorschrift für Bilder von Kamera 1.
Abbildungsvorschrift für Bilder von Kamera 2.
Interne Parameter der projektiven Kamera 1.
Parameteranzahl: CamParam1 == 8 || CamParam1 == 10 || CamParam1 == 12 || CamParam1 == 14
Interne Parameter der projektiven Kamera 2.
Parameteranzahl: CamParam2 == 8 || CamParam2 == 10 || CamParam2 == 12 || CamParam2 == 14
Punkttransformation von Kamera 2 zu Kamera 1.
Parameteranzahl: 7
Abtastfaktor.
Defaultwert: 1.0
Wertevorschläge: 0.5, 0.66, 1.0, 1.5, 2.0, 3.0, 4.0
Art der Entzerrung.
Defaultwert:
'geometric'
"geometric"
"geometric"
"geometric"
"geometric"
"geometric"
Werteliste: 'geometric'"geometric""geometric""geometric""geometric""geometric"
Art der Abbildungsvorschrift.
Defaultwert:
'bilinear'
"bilinear"
"bilinear"
"bilinear"
"bilinear"
"bilinear"
Werteliste: 'bilinear'"bilinear""bilinear""bilinear""bilinear""bilinear", 'coord_map_sub_pix'"coord_map_sub_pix""coord_map_sub_pix""coord_map_sub_pix""coord_map_sub_pix""coord_map_sub_pix", 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor"
Interne Parameter der entzerrten projektiven Kamera 1.
Parameteranzahl: CamParamRect1 == 8 || CamParamRect1 == 12
Interne Parameter der entzerrten projektiven Kamera 2.
Parameteranzahl: CamParamRect2 == 8 || CamParamRect2 == 12
Punkttransformation von der entzerrten Kamera 1 zur
ursprünglichen Kamera 1.
Parameteranzahl: 7
Punkttransformation von der entzerrten Kamera 2 zur
ursprünglichen Kamera 2.
Parameteranzahl: 7
Punkttransformation von der entzerrten Kamera 2
zur entzerrten Kamera 1.
Parameteranzahl: 7
* read the internal and external stereo parameters
read_cam_par ('cam_left.dat', CamParam1)
read_cam_par ('cam_right.dat', CamParam2)
read_pose ('relpos.dat', RelPose)
* compute the mapping for rectified images
gen_binocular_rectification_map (Map1, Map2, CamParam1, CamParam2, RelPose,\
1,'geometric', 'bilinear', CamParRect1, \
CamParamRect2, Cam1PoseRect1, \
Cam2PoseRect2, RelPoseRect)
* compute the disparities in online images
while (1)
grab_image_async (Image1, AcqHandle1, -1)
map_image (Image1, Map1, ImageMapped1)
grab_image_async (Image2, AcqHandle2, -1)
map_image (Image2, Map2, ImageMapped2)
binocular_disparity(ImageMapped1, ImageMapped2, Disparity, Score, 'sad', \
11, 11, 20, -40, 20, 2, 25, 'left_right_check', \
'interpolation')
endwhile
* read the internal and external stereo parameters
read_cam_par ('cam_left.dat', CamParam1)
read_cam_par ('cam_right.dat', CamParam2)
read_pose ('relpos.dat', RelPose)
* compute the mapping for rectified images
gen_binocular_rectification_map (Map1, Map2, CamParam1, CamParam2, RelPose,\
1,'geometric', 'bilinear', CamParRect1, \
CamParamRect2, Cam1PoseRect1, \
Cam2PoseRect2, RelPoseRect)
* compute the disparities in online images
while (1)
grab_image_async (Image1, AcqHandle1, -1)
map_image (Image1, Map1, ImageMapped1)
grab_image_async (Image2, AcqHandle2, -1)
map_image (Image2, Map2, ImageMapped2)
binocular_disparity(ImageMapped1, ImageMapped2, Disparity, Score, 'sad', \
11, 11, 20, -40, 20, 2, 25, 'left_right_check', \
'interpolation')
endwhile
* read the internal and external stereo parameters
read_cam_par ('cam_left.dat', CamParam1)
read_cam_par ('cam_right.dat', CamParam2)
read_pose ('relpos.dat', RelPose)
* compute the mapping for rectified images
gen_binocular_rectification_map (Map1, Map2, CamParam1, CamParam2, RelPose,\
1,'geometric', 'bilinear', CamParRect1, \
CamParamRect2, Cam1PoseRect1, \
Cam2PoseRect2, RelPoseRect)
* compute the disparities in online images
while (1)
grab_image_async (Image1, AcqHandle1, -1)
map_image (Image1, Map1, ImageMapped1)
grab_image_async (Image2, AcqHandle2, -1)
map_image (Image2, Map2, ImageMapped2)
binocular_disparity(ImageMapped1, ImageMapped2, Disparity, Score, 'sad', \
11, 11, 20, -40, 20, 2, 25, 'left_right_check', \
'interpolation')
endwhile
// read the internal and external stereo parameters
read_cam_par("cam_left.dat",CamParam1);
read_cam_par("cam_right.dat",CamParam2);
read_pose("relpos.dat",RelPose);
// compute the mapping for rectified images
gen_binocular_rectification_map(&Map1,&Map2,CamParam1,CamParam2,RelPose,1,
"geometric","bilinear",&CamParamRect1,
&CamParamRect2,&CamPoseRect1,&CamPoseRect2,
&RelPosRect);
// compute the disparities in online images
while (1)
{
grab_image_async(&Image1,AcqHandle1,-1);
map_image(Image1,Map1,&ImageMapped1);
grab_image_async(&Image2,AcqHandle2,-1);
map_image(Image2,Map2,&ImageMapped2);
binocular_disparity(ImageMapped1,ImageMapped2,&Disparity,&Score,"sad",
11,11,20,-40,20,2,25,"left_right_check",
"interpolation");
}
* read the internal and external stereo parameters
read_cam_par ('cam_left.dat', CamParam1)
read_cam_par ('cam_right.dat', CamParam2)
read_pose ('relpos.dat', RelPose)
* compute the mapping for rectified images
gen_binocular_rectification_map (Map1, Map2, CamParam1, CamParam2, RelPose,\
1,'geometric', 'bilinear', CamParRect1, \
CamParamRect2, Cam1PoseRect1, \
Cam2PoseRect2, RelPoseRect)
* compute the disparities in online images
while (1)
grab_image_async (Image1, AcqHandle1, -1)
map_image (Image1, Map1, ImageMapped1)
grab_image_async (Image2, AcqHandle2, -1)
map_image (Image2, Map2, ImageMapped2)
binocular_disparity(ImageMapped1, ImageMapped2, Disparity, Score, 'sad', \
11, 11, 20, -40, 20, 2, 25, 'left_right_check', \
'interpolation')
endwhile
* read the internal and external stereo parameters
read_cam_par ('cam_left.dat', CamParam1)
read_cam_par ('cam_right.dat', CamParam2)
read_pose ('relpos.dat', RelPose)
* compute the mapping for rectified images
gen_binocular_rectification_map (Map1, Map2, CamParam1, CamParam2, RelPose,\
1,'geometric', 'bilinear', CamParRect1, \
CamParamRect2, Cam1PoseRect1, \
Cam2PoseRect2, RelPoseRect)
* compute the disparities in online images
while (1)
grab_image_async (Image1, AcqHandle1, -1)
map_image (Image1, Map1, ImageMapped1)
grab_image_async (Image2, AcqHandle2, -1)
map_image (Image2, Map2, ImageMapped2)
binocular_disparity(ImageMapped1, ImageMapped2, Disparity, Score, 'sad', \
11, 11, 20, -40, 20, 2, 25, 'left_right_check', \
'interpolation')
endwhile
Sind die Parameterwerte korrekt, dann liefert
gen_binocular_rectification_mapgen_binocular_rectification_mapGenBinocularRectificationMapgen_binocular_rectification_mapGenBinocularRectificationMapGenBinocularRectificationMap den Wert 2 (H_MSG_TRUE).
binocular_calibrationbinocular_calibrationBinocularCalibrationbinocular_calibrationBinocularCalibrationBinocularCalibration
map_imagemap_imageMapImagemap_imageMapImageMapImage
gen_image_to_world_plane_mapgen_image_to_world_plane_mapGenImageToWorldPlaneMapgen_image_to_world_plane_mapGenImageToWorldPlaneMapGenImageToWorldPlaneMap
map_imagemap_imageMapImagemap_imageMapImageMapImage,
gen_image_to_world_plane_mapgen_image_to_world_plane_mapGenImageToWorldPlaneMapgen_image_to_world_plane_mapGenImageToWorldPlaneMapGenImageToWorldPlaneMap,
contour_to_world_plane_xldcontour_to_world_plane_xldContourToWorldPlaneXldcontour_to_world_plane_xldContourToWorldPlaneXldContourToWorldPlaneXld,
image_points_to_world_planeimage_points_to_world_planeImagePointsToWorldPlaneimage_points_to_world_planeImagePointsToWorldPlaneImagePointsToWorldPlane
3D Metrology