日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

Halcon 3D Vision

發(fā)布時(shí)間:2023/12/15 综合教程 32 生活家
生活随笔 收集整理的這篇文章主要介紹了 Halcon 3D Vision 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

3D Reconstruction Methods

兩個(gè)3D坐標(biāo)系的位置關(guān)系:旋轉(zhuǎn)分量矩陣的三個(gè)列向量為新坐標(biāo)系的三個(gè)軸向相對(duì)于舊坐標(biāo)系的坐標(biāo)。

Coordinate System Rotation Chains

? When reading a chain from the left to right, rotations are performed around the “new” axes.
? When reading a chain from the right to left, rotations are performed around the “old” axes.

The camera coordinate system is defined so that its x and y axes are parallel to the column and row axes of the image respectively, and the z axis is perpendicular to the image plane.

Measurement in a specified plane with a single camera

In halcon,the measurement plane is defined as the plane z=0 with respect to the world coordinate system.

確定測量平面位姿方法:

其中一個(gè)標(biāo)定板位置位于測量平面上

get_calib_data (CalibDataID, 'calib_obj_pose', [0,1], 'pose', Pose)   //[CalibObjIdx=0, CalibObjPoseIdx=1]

To compensate for the thickness of the calibration plate, the pose is moved by the corresponding value.

set_origin_pose( : : PoseIn, DX, DY, DZ : PoseNewOrigin)   //the translation is performed relative to the local coordinate system of the pose itself

set_origin_pose(: :PoseIn, 0, 0, d: PoseNewOrigin)//d為標(biāo)定板厚度,PoseNewOrigin為真實(shí)測量平面姿態(tài)

標(biāo)定板不位于測量平面上

首先對(duì)相機(jī)進(jìn)行標(biāo)定,標(biāo)定時(shí)相機(jī)可以先不固定。可以標(biāo)定完成后將相機(jī)安裝到測量位置,標(biāo)定板放置到測量平面上,相機(jī)拍攝板定板圖像,從而獲取測量平面位姿。通過get_calib_data_observ_points()獲取位姿。

使用3D點(diǎn)和對(duì)應(yīng)的圖像點(diǎn)坐標(biāo)點(diǎn)對(duì)

vector_to_pose( : : WorldX, WorldY, WorldZ, ImageRow, ImageColumn, CameraParam, Method, QualityType : Pose, Quality)

Use halcon calibration plate,the whole process of finding the calibration plate,extract the marks and determine the corresponddence between the marks and the respective 3D world coordinates can be carried automatically.Even more important, these calibration plates are highly accurate, down to 1 μm or below, which is aprerequisite for high accuracy applications.

Calibration plates with hexagonally arranged marks and calibration marks with rectangularly arranged marks are available. The calibration plates with hexagonally arranged marks are introduced with HALCON 12 and are recommended for most applications, as they provide the following advantages compared to the calibration plates with rectangularly arranged marks:

? The calibration plates with rectangularly arranged marks should fill a fourth of the image area. To
cover the whole field of view including different tilts, many images (at least 10 to 20) are needed.
As calibration plates with hexagonally arranged marks contain a significantly larger number of
calibration marks and therefore can and should cover the whole image area with a single image,
less images (6 to 7) are needed to get a comparable calibration result.
? The calibration plates with rectangularly arranged marks must be completely visible in the im-
ages whereas plates with hexagonally arranged marks may protude beyond the rim of the image.
Thus, with the latter less care must be taken when placing the calibration plate in the images.
The acquisition of the calibration images becomes faster and more convenient without a loss of
robustness.

標(biāo)定板描述文件

The description files for calibration plates with hexagonally arranged marks have the file extension ’.cpd’ and those of the calibration plates with rectangularly arranged marks have the file extension ’.descr’.

Image coordinate --> World coordinate

In halcon,the region cannot be transformed directly into the world coordinate system.you should first convert them into XLD contours by gen_contour_region_xld(),then use the operator contour_to_world_plane_xld().

World coordinate--> Image coordinate

pose_to_hom_mat3d()  affine_trans_point_3d()  project_3d_point()

3D Position Recognition of Known Object

3D-2D points pair(mono 3D)

Shape-based 3D matching

Surface-based 3D matching (Volume matching)

3D Primitives Fitting

Perspective matching (calibratedperspective deformable matching,calibrated descriptor-based matching)

circle/rectangle pose estimation

Pose Estimation from Points

disp_3d_coord_system( : : WindowHandle, CamParam, Pose, CoordAxesLength : ) //顯示3D坐標(biāo)系

vector_to_pose( : : WorldX, WorldY, WorldZ, ImageRow, ImageColumn, CameraParam, Method, QualityType : Pose, Quality) //通過點(diǎn)對(duì)計(jì)算姿態(tài)

find_caltab(Image : CalPlate : CalPlateDescr, SizeGauss, MarkThresh, MinDiamMarks : ) //從圖片中找出標(biāo)定板區(qū)域

find_marks_and_pose() //Extract rectangularly arranged 2D calibration marks from the image and calculate initial values for the external camera parameters.

Pose Estimation Using Shape-based 3D Matching

  The 3D shape model is generated by computing different views of the 3D object model within a user-specified pose range. The views are obtained by placing virtual cameras around the object model and projecting the 3D object model into the image plane of each camera position. The resulting 2D shape representations of all views are stored in the 3D shape model.

  An important task is to specify the pose range. To ease this task, imagine a sphere that surrounds the object. On the surface of the sphere, a camera is placed that looks at the object. Now, the pose range can be defined by restricting the position of the camera to a part of the sphere’s surface. Additionally, the
minimum and maximum distance of the camera to the object, i.e., the radii of different spheres, must be specified.

物體坐標(biāo)系的xz面定義為赤道面,N極為負(fù)y軸方向,零經(jīng)線與赤道交點(diǎn)位于z軸上。

read_shape_model_3d(),create_shape_model_3d(),find_shape_model_3d()

Pose Estimation Using Surface-Based 3D Matching

The surface model consists of a set of 3D points and the points' normal vectors.In contrast to shape-based matching,the instances of object are not located in images but in a 3D scene.

create_surface_model(),find_surface_model(),get_surface_matching_result()

Pose Estimation Using Deformable Surface-Based 3D Matching

create_deformable_surface_model()

find_deformable_surface_model()

add_deformable_surface_model_reference_point() //定義參考點(diǎn),可位于任何位置,可用于確定抓取物體時(shí)的抓取點(diǎn)

get_deformable_surface_matching_result()

Pose Estimation Using 3D Primitives Fitting

fit_primitives_object_model_3d()

segment_object_model_3d()

Pose Estimation Using Calibrated Perspective Deformable Matching

create_planar_calib_deformable_model()

find_planar_calib_deformable_model()

Pose Estimation Using Calibrated Descriptor-Based Matching

Note that the calibrated descriptor-based matching is suitable mainly to determine the 3D pose of planar objects with characteristic texture and distinctive object points. For low-textured objects with rounded edges you should select one of the other pose estimation approaches. Further, thedescriptor-basedmatch-
ing is less accurate than the perspective deformable matching. But on the other hand, it is significantly faster if a large search space, e.g., caused by a large scale range, is used.

Pose Estimation for Cirlces

It is based on the known geometrical behavior of perspectively distorted circles. In particular, 3D circles are represented as ellipses in the image. Using the extracted 2D ellipse of a 3D circle together with the internal camera parameters and the known radius of the circle, the two possible 3D poses of the circle (having the same position but opposite orientations) can be obtained easily using the operator get_circle_pose.

Pose Estimation for Rectangles

In particular, a contour is segmentedinto four line segments and their intersections are considered as the corners of a quadrangular contour.Using the extracted 2D quadrangle of the 3D rectangle together with the internal camera parametersand the known size of the rectangle, the four (or eight in case of a square) possible 3D poses of therectangle can be obtained easily using the operator get_rectangle_pose.

3D Vison with a Stereo System

雙目

立體匹配方法有:

correlation-basedstereo matching:fast,can be parallelized and is invariant against gray-value chages,works good only for significantly textured areas.

multigrid stereo matching:interpolates 3D information for areas without texture based on the surrounding areas,in particular for edges, the accuracy in general is higher than for correlation-based stereo, andthe resolution is higher than for correlation-based stereo, i.e., smaller objects can be reconstructed.

multi-scanline stereo matching:determines 3D information for areas with little texture,runtime increases significantly with image size and disparity search range andhigh memory consumption.

計(jì)算視差:binocular_disparity(),binocular_disparity_mg(),binocular_disparity_ms(),計(jì)算結(jié)果以第一個(gè)rectified image為參考,the disparity for thepoint (r,c) of the first rectified image is the gray value at the position (r,c) of the disparity image.

計(jì)算距離:The distance of an object point from the stereo camera system is defined as its distance from the x-y-plane of the coordinate system of the first rectified camera.

binoclular_distance(),binocular_distance_mg(),binocular_distance_ms(),disparity_to_distance(),

計(jì)算3D坐標(biāo):disparity_to_point_3d(),disparity_image_to_xyz()

Laser Triangulation with Sheet ofLight

A sheet of light can be calibrated in two different ways:using a standard HALCON calibration plate or using a special 3D calibration object.

The calibration of the sheet-of-light setup is applied to get the internal and external camera parameters,the orientation of the light plane in the WCS, and the relative movement of the object between two successive measurements.

Depth from Focus

The setup requires only a single camera, therefore, it is possibly more compact than, e.g., a stereo setup. DFF requires, however, cameras with telecentric or microscope lenses in order to achieve a (nearly) parallel projection. Therefore, DFF is only suitable for small objects.

圖像銳度評(píng)價(jià):hdevelopApplicationsGeneraldetermine_sharpness.hdev

Robot Vision

典型的關(guān)節(jié)型機(jī)器人有6個(gè)自由度,SCARA機(jī)器人有4個(gè)自由度(3平移+1旋轉(zhuǎn))

For articulated robots(關(guān)節(jié)型機(jī)器人) that are used together with one camera, it is possible to calibrate the camera together with the hand-eye setup. For SCARA robots and all systems that use stereo or multi-view setups, the camera(s) must be calibrated in advance.

對(duì)于關(guān)節(jié)型機(jī)器人,如果手眼標(biāo)定前,相機(jī)已經(jīng)經(jīng)過標(biāo)定,則相機(jī)內(nèi)參參數(shù)應(yīng)該從優(yōu)化參數(shù)中排除:

set_calib_data (CalibDataID, 'camera', 'general', 'excluded_settings','params')

對(duì)于SCARA機(jī)器人,相機(jī)需要提前經(jīng)過標(biāo)定,相機(jī)內(nèi)參參數(shù)會(huì)自動(dòng)從待優(yōu)化參數(shù)中排除,無需再手動(dòng)設(shè)置。

手眼標(biāo)定時(shí),如果使用相機(jī)+標(biāo)定板時(shí),create_calib_data()中,NumCameras和NumCalibObjects參數(shù)指定為1,使用3D傳感器時(shí),這兩個(gè)參數(shù)指定為0.

Please note that for the hand-eye calibration we stronglyrecommend to use the calibration plate with hexagonally arranged calibration marks.

使用3D sensor時(shí),直接將姿態(tài)設(shè)置到標(biāo)定數(shù)據(jù)模型中:set_calib_data_observ_pose (CalibDataID, 0, 0, I, ObjInCamPose)

Determine Translation in Z Direction for SCARA Robots

  When calibrating SCARA robots, it is not possible to determine the Z translation of ’obj_in_base_pose’ (moving camera) or ’obj_in_tool_pose’ (stationary camera). To eliminate this ambiguity the Z translation is internally set to 0.0 in these poses and the poses ’tool_in_cam_pose’ (moving camera) and
’base_in_cam_pose’ (stationary camera), respectively, are calculated accordingly. It is necessary to determine the true translation in Z after the calibration by moving the robot to a pose of known height in the camera coordinate system. For this, the following approach can be applied:

總結(jié)

以上是生活随笔為你收集整理的Halcon 3D Vision的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。