Halcon例程gen_projective_mosaic拼接流程

来源:互联网 发布:ubuntu中安装jenkins 编辑:程序博客网 时间:2024/06/10 01:49

Halcon例程gen_projective_mosaic拼接流程

此例程要求待拼接图像由上向下依次排列

1、  特征点寻找算子:

points_foerstner:Detect points of interest using the Förstner operator

points_harris:Detect points of interest using the Harris operator

points_sojka :Find corners using the Sojka operator

2、 特征点匹配算子:

proj_match_points_ransacCompute a projectivetransformation matrix between two images by finding correspondences betweenpoints.通过寻找点之间的对应关系来计算两幅图像之间的投影变换矩阵

两个步骤中确定变换,首先,确定在第一和第二图像中的输入点周围的掩模窗口的灰度值相关性,并且利用两个图像中的窗口的相似性生成它们之间的初始匹配

Thetransformation is determined in two steps: First, gray value correlations ofmask windows around the input points in the first and the second image aredetermined and an initial matching between them is generated using thesimilarity of the windows in both images.

初始匹配工作完成以后,使用随机搜索算法(RANSAC)来确定变换矩阵HomMat2D.它试图发现与对应的最大数目一致矩阵。变换预测坐标距离不得超过阈值DistanceThreshold

Once the initialmatching is complete, a randomized search algorithm (RANSAC) is used todetermine the transformation matrixHomMat2D. It tries to findthe matrix that is consistent with a maximum number of correspondences. For apoint to be accepted, its distance from the coordinates predicted by thetransformation must not exceed the threshold DistanceThreshold.

相匹配点选择以后,使用所有的匹配一直点进行进一步的优化,优化方法可以选择为'gold_standard' 或者'normalized_dlt',前者效果好但是慢,后者速度要快些。用到了vector_to_proj_hom_mat2d算子。

Once a choicehas been made, the matrix is further optimized using all consistent points. Forthis optimization, theEstimationMethod can be chosen to either bethe slow but mathematically optimal 'gold_standard' method or the faster'normalized_dlt'. Here, the algorithms of vector_to_proj_hom_mat2d are used.

3、 拼接图像生成算子:

gen_projective_mosaicCombine multiple images intoa mosaic image.将多幅图像拼接成一幅拼接图像

4、 显示缝隙seam

5、 光束法平差对所有图片进行相机参数校正:BundleAdjustment(光束法平差)算法主要是解决所有相机参数的联合。这是全景拼接必须的一步,因为多个成对的单应性矩阵合成全景图时,会忽略全局的限制,造成累积误差。因此每一个图像都要加上光束法平差值,使图像被初始化成相同的旋转和焦距长度。光束法平差的目标函数是一个具有鲁棒性的映射误差的平方和函数。即每一个特征点都要映射到其他的图像中,计算出使误差的平方和最小的相机参数

bundle_adjust_mosaic:Perform a bundle adjustment of an image mosaic

参数Transformation确定用于光束法调整转换图像点的一类变换,这可以用来限制允许的变换.

Transformation = 'projective',  projective transformations

Transformation = 'affine',  affine transformations

Transformation = 'similarity',  similarity transformations

Transformation = 'rigid',  rigid transformations

The parameter Transformation determines the class oftransformations that is used in the bundle adjustment to transform the imagepoints. This can be used to restrict the allowable transformations. For Transformation = 'projective', projective transformationsare used (see vector_to_proj_hom_mat2d).For Transformation = 'affine', affine transformations areused (see vector_to_hom_mat2d),for Transformation = 'similarity', similarity transformations(see vector_to_similarity),and for Transformation = 'rigid' rigid transformations (see vector_to_rigid).

6、 调整后拼接图像生成算子

gen_bundle_adjusted_mosaic :Combine multiple imagesinto a mosaic image


优点:速度快

缺点:没有图像融合部分,接缝明显

0 0
原创粉丝点击