halcon使用点拟合圆形时候,点集顺序紊乱,不影响圆形拟合效果

read_image (Image, '截图20201226094342972.bmp')
* Matching 01: BEGIN of generated code for model initialization
set_system ('border_shape_models', 'false')
* Matching 01: Obtain the model image
* Matching 01: The image is assumed to be made available in the
* Matching 01: variable last displayed in the graphics window
copy_obj (Image, Image, 1, 1)
* Matching 01: build the ROI from basic regions
gen_rectangle1 (ModelRegion, 28.468, 280.863, 93.22, 334.675)
* Matching 01: reduce the model template
reduce_domain (Image, ModelRegion, TemplateImage)
* Matching 01: create the shape model
create_shape_model (TemplateImage, 3, rad(0), rad(0), rad(4.1992), ['none','no_pregeneration'], 'use_polarity', [10,11,4], 7, ModelId)
* Matching 01: get the model contour for transforming it later into the image
get_shape_model_contours (ModelContours, ModelId, 1)
* Matching 01: END of generated code for model initialization
* Matching 01: BEGIN of generated code for model application
* Matching 01: the following operations are usually moved into
* Matching 01: that loop where the aquired images are processed
* Matching 01: Find the model
find_shape_model (Image, ModelId, rad(0), rad(0), 0.5, 0, 0.5, 'least_squares', [3,1], 0.75, ModelRow, ModelColumn, ModelAngle, ModelScore)
* Matching 01: transform the model contours into the detected positions
for MatchingObjIdx := 0 to |ModelScore| - 1 by 1
    hom_mat2d_identity (HomMat)
    hom_mat2d_rotate (HomMat, ModelAngle[MatchingObjIdx], 0, 0, HomMat)
    hom_mat2d_translate (HomMat, ModelRow[MatchingObjIdx], ModelColumn[MatchingObjIdx], HomMat)
    affine_trans_contour_xld (ModelContours, TransContours, HomMat)
    dev_display (TransContours)
endfor



gen_contour_polygon_xld (Contour, ModelRow, ModelColumn)


fit_circle_contour_xld (Contour, 'algebraic', -1, 0, 0, 3, 2, Row, Column, Radius, StartPhi, EndPhi, PointOrder)

gen_circle_contour_xld (ContCircle, Row, Column, Radius, 0, 6.28318, 'positive', 1)

* Matching 01: Clear model when done
clear_shape_model (ModelId)
* Matching 01: END of generated code for model application

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值