设置首页收藏本站
12
返回列表 发新帖
开启左侧

计算一个圆环的最大厚度,但圆环内圈并不光滑

[复制链接]
FONG93 发表于 2016-10-28 08:47:42 | 显示全部楼层
学习大神操作,谢谢无私的分享!!!!
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
opencv 发表于 2016-12-5 15:51:24 | 显示全部楼层
您好,有一处我不太懂,计算厚度时,
MinDis:=Radius2-DistanceOut-Radius
MaxDis:=Radius2+DistanceIn-Radius
这块我还是有点没太弄明白  为什么计算厚度时,考虑两个圆同心度问题。
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
chenheren339 发表于 2016-12-9 11:11:33 | 显示全部楼层
read_image (Image, '1.bmp')
dev_close_window()
dev_open_window_fit_image(Image, 0, 0, -1, -1, WindowHandle)
dev_display(Image)
threshold(Image, Region, 0, 80)
closing_circle(Region, RegionClosing, 5)
fill_up(RegionClosing, RegionFillUp)
*求外圆
opening_circle(RegionFillUp, RegionOpening1, 2)
connection(RegionOpening1, ConnectedRegions1)
select_shape_std(ConnectedRegions1, SelectedRegions1, 'max_area', 50)
gen_contour_region_xld(SelectedRegions1, Contours, 'border')
fit_circle_contour_xld(Contours, '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)
*求内圆
difference(RegionFillUp, RegionClosing, RegionDifference)
opening_circle(RegionDifference, RegionOpening, 2)
connection(RegionOpening, ConnectedRegions)
select_shape_std(ConnectedRegions, SelectedRegions, 'max_area', 70)
gen_contour_region_xld(SelectedRegions, Contours1, 'border')
smallest_circle_xld(Contours1, Row1, Column1, Radius1)
gen_circle_contour_xld(ContCircle1, Row1, Column1, Radius1, 0, 6.28318, 'positive', 1)
*显示
dev_clear_window()
dev_display(Image)
dev_display(ContCircle1)
dev_display(ContCircle)
disp_message(WindowHandle, '厚度为:'+(Radius-Radius1), 'window', Row1, Column1, 'black', 'true')
1.PNG
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
Eli 发表于 2018-5-18 14:59:08 | 显示全部楼层
这个不难吧
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
爱上向日葵 发表于 2018-8-29 17:14:28 | 显示全部楼层
opencv 发表于 2016-12-5 15:51
您好,有一处我不太懂,计算厚度时,
MinDis:=Radius2-DistanceOut-Radius
MaxDis:=Radius2+DistanceIn-Rad ...

两个圆心连线,就是环的最厚和最薄地方,画个图出来比较直观了
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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