开启左侧

spoke卡圆工具 和 metrology_model是一个东西吧

[复制链接]
wess 发表于 2018-8-22 11:20:21 | 显示全部楼层 |阅读模式


  1. import './spoke.hdvp'
  2. import './pts_to_best_circle.hdvp'
  3. import './draw_spoke.hdvp'
  4. read_image (Image, 'pads')
  5. get_image_size (Image, Width, Height)
  6. dev_close_window ()
  7. dev_open_window (0, 0, 384, 288, 'black', WindowHandle)
  8. dev_set_window_extents (0, 0, 384, 288)
  9. dev_set_part (471, 406, 521, 473)
  10. dev_display (Image)

  11. * draw_spoke (Image, Regions, 200000, 30, 60, 15, ROIRows, ROICols, Direct)

  12. gen_circle_contour_xld (ROI_0, 495.7, 438.1, 16.7141, 0, 6.28318, 'positive', 1)
  13. smallest_circle_xld (ROI_0, Row1, Column1, Radius1)
  14. get_contour_xld (ROI_0, Row, Col)

  15. Length1:=10.0
  16. Length2:=5.0
  17. Sigme:=0.5
  18. Threshold:=1.0
  19. spoke (Image, Regions1, 100, Length1, Length2, Sigme, Threshold, 'all', 'max', Row, Col, 'outer', ResultRow1, ResultColumn1, ArcType)
  20. gen_cross_contour_xld (Cross, ResultRow1, ResultColumn1, 3, 0.785398)
  21. pts_to_best_circle (Circle, ResultRow1, ResultColumn1,|ResultRow1|, ArcType, RowCenter, ColCenter, Radius, StartPhi, EndPhi, PointOrder, ArcAngle)
  22. remove_obj (Regions1, Regions1, 1)
  23. remove_obj (Regions1, Regions1, 2)
  24. dev_display (Image)
  25. dev_set_line_width (1)
  26. dev_set_color ('red')
  27. dev_display (ROI_0)
  28. Color := ['gray','cyan','green']
  29. dev_set_color (Color[0])
  30. dev_display (Regions1)
  31. dev_set_color (Color[1])
  32. dev_display (Cross)
  33. dev_set_color (Color[2])
  34. dev_display (Circle)
  35. dev_disp_text ([RowCenter, ColCenter, Radius], 'image', RowCenter, ColCenter, 'black', [], [])
  36. dev_disp_text ('spoke', 'window', 'top', 'left', 'black', [], [])
  37. stop ()

  38. dev_open_window (0, 0, 384, 288, 'black', WindowHandle1)
  39. dev_set_window_extents (0, 384, 384, 288)
  40. dev_set_part (471, 406, 521, 473)
  41. dev_display (Image)
  42. create_metrology_model (MetrologyHandle)
  43. set_metrology_model_image_size (MetrologyHandle, Width, Height)
  44. add_metrology_object_circle_measure (MetrologyHandle, Row1, Column1, Radius1, Length1/2, Length2/2, Sigme, Threshold, [], [], Index)
  45. set_metrology_object_param (MetrologyHandle, Index, 'num_measures', 35)
  46. apply_metrology_model (Image, MetrologyHandle)
  47. get_metrology_object_result (MetrologyHandle, Index, 'all', 'result_type', 'all_param', RectangleParameter)
  48. get_metrology_object_result_contour (Contours, MetrologyHandle, 'all', 'all', 1.5)
  49. get_metrology_object_measures (Contour, MetrologyHandle, 'all', 'all', Row1, Column1)
  50. gen_cross_contour_xld (Cross, Row1, Column1, 3, 0.785398)
  51. dev_display (Image)
  52. dev_set_line_width (1)
  53. dev_set_color ('red')
  54. dev_display (ROI_0)
  55. dev_set_color (Color[0])
  56. dev_display (Contour)
  57. dev_set_color (Color[1])
  58. dev_display (Cross)
  59. dev_set_color (Color[2])
  60. dev_display (Contours)
  61. dev_disp_text (RectangleParameter, 'image', RectangleParameter[0], RectangleParameter[1], 'black', [], [])
  62. dev_disp_text ('metrology_model', 'window', 'top', 'left', 'black', [], [])
复制代码
Princess 发表于 2018-8-22 12:16:38 | 显示全部楼层
你这个厉害了,还真是有点像!{:1_326:}
夜行人 发表于 2018-8-22 16:46:51 | 显示全部楼层
原理是一样的,都是运行高数极限分割的思想
flcok 发表于 2018-8-24 08:30:46 | 显示全部楼层
原理差不多,效果一样!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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