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

踏脚检测,求助大佬

[复制链接]
hankchang 发表于 2025-1-21 14:07:49 | 显示全部楼层
考慮使用MLP 分類器
有時候問題不好用簡單的邏輯判斷
建議使用機器學習的方法 只要抓取有效特徵 分類效果通常不錯 而且僅使用CPU
訓練很快 推論也很快 不需要 高貴顯卡
  1. dev_close_window()
  2. dev_open_window(0, 0, 512, 512, 'black', WindowHandle)
  3. read_image (TopDefect, 'C:/Users/genel/OneDrive/桌面/塑膠件瑕疵/top_defect.png')
  4. read_image (Normal01, 'C:/Users/genel/OneDrive/桌面/塑膠件瑕疵/normal_01.jpg')

  5. decompose3(Normal01, Image1, Image2, Image3)
  6. get_top(Image3, top1, base_edge, base_region)
  7. shape_trans (top1, RegionTrans, 'ellipse')
  8. smallest_rectangle1(RegionTrans, Row11, Column11, Row2, Column2)
  9. partition_rectangle (RegionTrans, Partitioned, (Column2-Column11)/20.0, (Row2-Row11))
  10. area_center(Partitioned, Area, Row_p, Column_p)
  11. gen_cross_contour_xld(Cross, Row_p, Column_p, 6, 0)

  12. **ref row
  13. area_center(base_region, Area2, Row_ref, Column_ref)
  14. dif:=Row_ref-Row_p
  15. ***----------------------------
  16. decompose3(TopDefect, Image11, Image21, Image31)
  17. get_top(Image31, top11, base_edge1, base_region1)

  18. shape_trans (top11, RegionTrans1, 'ellipse')
  19. smallest_rectangle2(RegionTrans1, Row1, Column1, Phi1, Length11, Length21)
  20. smallest_rectangle1(RegionTrans1, Row12, Column12, Row21, Column21)
  21. partition_rectangle (RegionTrans1, Partitioned1, (Column21-Column12)/20.0, (Row21-Row12))
  22. area_center(Partitioned1, Area1, Row_p1, Column_p1)
  23. gen_cross_contour_xld(Cross1, Row_p1, Column_p1, 6, 0)
  24. area_center(base_region1, Area2, Row_ref1, Column_ref1)
  25. dif1:=Row_ref1-Row_p1

  26. ***分兩類: 0--> 正常 , 凹陷-->1
  27. create_class_mlp (22, 10, 2, 'softmax', 'normalization', 10, 42, MLPHandle)

  28. add_sample_class_mlp(MLPHandle, [Row_ref,Column_ref,Row_p], 0)
  29. add_sample_class_mlp(MLPHandle, [Row_ref1,Column_ref1,Row_p1], 1)
  30. train_class_mlp(MLPHandle, 200, 1, 0.01, Error, ErrorLog)
复制代码

正常

正常

凹陷

凹陷


奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
回复 支持 2 反对 0

使用道具 举报

寤寐求之 发表于 2025-1-21 14:21:39 | 显示全部楼层
hankchang 发表于 2025-1-21 14:07
考慮使用MLP 分類器
有時候問題不好用簡單的邏輯判斷
建議使用機器學習的方法 只要抓取有效特徵 分類效果 ...

大佬有没有源码发一下我学习一下
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
hankchang 发表于 2025-1-21 14:34:29 | 显示全部楼层
代碼不是在上面?
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
 楼主| qweerzhou 发表于 2025-1-22 16:17:42 | 显示全部楼层
大佬厉害, 麻烦发下get_top方法的内容
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
hankchang 发表于 2025-1-23 09:18:20 | 显示全部楼层
get_top 請參考

get_top.hdvp

1.85 KB, 下载次数: 13

奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
 楼主| qweerzhou 发表于 2025-1-23 13:17:48 | 显示全部楼层

感谢大佬
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
luliang971212 发表于 2025-2-11 10:41:19 | 显示全部楼层
用AI把腰线的区域提取出来,再算面积。
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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