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

structured_light_tap_collar.hdev中的图片路径在哪里设置?

[复制链接]
gongxiaolei90 发表于 2020-7-23 18:01:10 | 显示全部楼层 |阅读模式
本帖最后由 gongxiaolei90 于 2020-7-27 11:26 编辑

今天看了structured_light_tap_collar.hdev示例,但是没有明白它的图片路径在哪里设置的?

  1. * This example shows the main workflow necessary when using the method
  2. * of deflectometry for defect detection on specular surfaces.
  3. *
  4. * It can be used as a template for your own application, in which case
  5. * certain parameters need to be adapted to the particular setup.
  6. *
  7. dev_update_off ()
  8. dev_close_window ()
  9. dev_open_window (0, 0, 600, 450, 'black', WindowHandle)
  10. set_display_font (WindowHandle, 14, 'mono', 'true', 'false')
  11. *
  12. dev_displ_workflow_text ()
  13. stop ()

  14. * First a structured light model of type 'deflectometry'
  15. * needs to be created and the parameters necessary for the
  16. * generation of the pattern images need to be set.
  17. create_structured_light_model ('deflectometry', StructuredLightModel)
  18. *
  19. * --- Adapt the following parameters to your application ---
  20. * Height and width of the pattern images that are to be
  21. * displayed on the monitor.
  22. PatternWidth := 1600
  23. PatternHeight := 1200
  24. * Pattern type that is to be used. In this case, phase shift
  25. * images in addition to gray code images are displayed.
  26. PatternType := 'gray_code_and_phase_shift'
  27. * Orientation of the pattern images. In this case,
  28. * we display patterns with stripes in both the vertical and
  29. * the horizontal direction.
  30. PatternOrientation := 'both'
  31. * Minimum width of the stripes appearing in the
  32. * gray code images. The parameter is chosen such that the
  33. * smallest stripes are still clearly visible in the camera
  34. * images.
  35. MinStripeWidth := 8
  36. * Type of normalization to be used in order to decode
  37. * the gray code images. In this case we use the type 'global'
  38. * in which a completely white image and a completely black
  39. * image are additionally displayed.
  40. Normalization := 'global'
  41. * Set the above parameters in the structured light model.
  42. set_structured_light_model_param (StructuredLightModel, ['pattern_width','pattern_height','pattern_type','pattern_orientation','min_stripe_width','normalization'], [PatternWidth,PatternHeight,PatternType,PatternOrientation,MinStripeWidth,Normalization])
  43. *
  44. dev_disp_parameters_text ()
  45. stop ()
  46. *
  47. * Generate the pattern images to be displayed on the monitor.
  48. gen_structured_light_pattern (PatternImages, StructuredLightModel)
  49. *
  50. dev_disp_acquisition_text ()
  51. stop ()
  52. * Display the images on the monitor and acquire the
  53. * the corresponding camera images.
  54. acquire_camera_images_deflectometry (PatternImages, CameraImages, PatternWidth, PatternHeight)
  55. *
  56. * The camera images can now be decoded.
  57. * Set the parameter 'min_gray_difference' to a suitable value.
  58. MinGrayDifference := 130
  59. set_structured_light_model_param (StructuredLightModel, 'min_gray_difference', MinGrayDifference)
  60. dev_disp_decoding_text ()
  61. stop ()
  62. decode_structured_light_pattern (CameraImages, StructuredLightModel)
  63. * Get the computed correspondences images.
  64. get_structured_light_object (CorrespondenceImages, StructuredLightModel, 'correspondence_image')
  65. dev_clear_window ()
  66. select_obj (CorrespondenceImages, CorrespondenceColumn, 1)
  67. dev_display (CorrespondenceColumn)
  68. dev_disp_text (['Correspondence image (1/2): Column values of the corresponding','                            monitor pixels'], 'window', 'top', 'left', 'black', [], [])
  69. dev_disp_text ('Press Run (F5) to continue', 'window', 'bottom', 'right', 'black', [], [])
  70. stop ()
  71. dev_clear_window ()
  72. select_obj (CorrespondenceImages, CorrespondenceRow, 2)
  73. dev_display (CorrespondenceRow)
  74. dev_disp_text (['Correspondence image (2/2): Row values of the corresponding','                            monitor pixels'], 'window', 'top', 'left', 'black', [], [])
  75. dev_disp_text ('Press Run (F5) to continue', 'window', 'bottom', 'right', 'black', [], [])
  76. stop ()
  77. *
  78. * Defect image
  79. dev_disp_defects_text ()
  80. stop ()
  81. * Get the defect image.
  82. Sigma := 1
  83. set_display_font (WindowHandle, 14, 'mono', 'true', 'false')
  84. set_structured_light_model_param (StructuredLightModel, 'derivative_sigma', Sigma)
  85. get_structured_light_object (DefectImage1, StructuredLightModel, 'defect_image')
  86. scale_image_range (DefectImage1, ScaledDefectImage1, 0, 4)
  87. dev_clear_window ()
  88. dev_display (ScaledDefectImage1)
  89. dev_disp_text ('Defect image with \'derivative_sigma\' set to ' + Sigma + ':', 'window', 'top', 'left', 'black', [], [])
  90. *
  91. * Get a defect image with a different value of 'derivative_sigma'.
  92. Sigma := 5
  93. dev_open_window (0, 609, 600, 450, 'black', WindowHandle2)
  94. set_display_font (WindowHandle2, 14, 'mono', 'true', 'false')
  95. dev_set_window (WindowHandle2)
  96. set_structured_light_model_param (StructuredLightModel, 'derivative_sigma', Sigma)
  97. get_structured_light_object (DefectImage5, StructuredLightModel, 'defect_image')
  98. scale_image_range (DefectImage5, ScaledDefectImage5, 0, 1)
  99. dev_display (ScaledDefectImage5)
  100. dev_disp_text ('Defect image with \'derivative_sigma\' set to ' + Sigma + ':', 'window', 'top', 'left', 'black', [], [])
复制代码
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
Criss 发表于 2020-7-23 18:34:17 | 显示全部楼层
你说的是acquire_camera_images_deflectometry算子里面出现的图片么?
  1. DirName := 'structured_light/tap_collar/'
  2. open_framegrabber ('File', -1, -1, -1, -1, -1, -1, 'default', -1, 'default', -1, 'default', DirName, 'default', -1, -1, AcqHandle)
复制代码
图片属于HALCON配置的默认图片目录下/structured_light/tap_collar/
具体路径为:C:\Users\Public\Documents\MVTec\HALCON-20.05-Progress\examples\images\structured_light\tap_collar
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
 楼主| gongxiaolei90 发表于 2020-7-27 11:25:12 | 显示全部楼层
Criss 发表于 2020-7-23 18:34
你说的是acquire_camera_images_deflectometry算子里面出现的图片么?
图片属于HALCON配置的默认图片目录下 ...

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

本版积分规则

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