设置首页收藏本站
授权版本:2024_10
开启左侧

找边缘直线,边缘像素接近,如何找到这条直线

[复制链接]
chanda 发表于 2023-12-4 17:09:38 | 显示全部楼层 |阅读模式
如题,感谢

20231202152626552.jpg 202312021526265521.jpg

奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
zjjdsg 发表于 2023-12-4 20:27:32 | 显示全部楼层
图像预处理一下搞明显点在检测
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
halcon2016 发表于 2023-12-5 08:59:49 | 显示全部楼层
二维测量
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
fate. 发表于 2023-12-5 10:33:21 | 显示全部楼层
1、筛选出轮廓,得到这条xld,用fit_line去拟合这根直线,
2、搞点图像增强,用measure_pos找多个点,在用fit_line去拟合这几个点
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
invoker1992 发表于 2023-12-6 10:56:43 | 显示全部楼层

read_image (Image, 'C:/Users/sunjie/Desktop/2D测量/170908cg0z381ud1qw0gub.jpg')

rgb1_to_gray (Image, GrayImage)

median_image (GrayImage, ImageMedian, 'square', 4, 'mirrored')

emphasize (ImageMedian, ImageEmphasize, 21, 21, 2)


create_metrology_model (MetrologyHandle)

dev_get_window (WindowHandle)

draw_rectangle2 (WindowHandle, Row, Column, Phi, Length1, Length2)

gen_rectangle2 (Rectangle, Row, Column, Phi, Length1, Length2)


RowBegin := Row + Length1 * sin(Phi)

ColBegin := Column - Length1 * cos(Phi)

RowEnd   := Row - Length1 * sin(Phi)

ColEnd   := Column + Length1 * cos(Phi)


gen_cross_contour_xld (Cross, RowBegin, ColBegin, 16, 0)

gen_cross_contour_xld (Cross1, RowEnd, ColEnd, 16, 0)


add_metrology_object_line_measure (MetrologyHandle,RowBegin,ColBegin,RowEnd,ColEnd, 20, 5, 1.5, 30, [], [], Index)

set_metrology_object_param (MetrologyHandle, 'all', 'num_instances', 1)

set_metrology_object_param (MetrologyHandle, 'all', 'measure_transition', 'negative')

set_metrology_object_param (MetrologyHandle, 'all', 'measure_select', 'first')

set_metrology_object_param (MetrologyHandle, 'all', 'min_score', 0.95)

apply_metrology_model (ImageEmphasize, MetrologyHandle)

get_metrology_object_measures (Contours, MetrologyHandle, 0, 'all', Row1, Column1)

get_metrology_object_result (MetrologyHandle, 0, 'all', 'result_type', 'all_param', Parameter)

get_metrology_object_result_contour (Contour, MetrologyHandle, 0, 'all', 1.5)










屏幕截图 2023-12-06 105430.png
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表