51Halcon机器视觉

 找回密码
 会员注册

QQ登录

只需一步,快速开始

扫一扫,微信登录

查看: 141|回复: 2
收起左侧

[已解决] structured_light_tap_collar.hdev中的图片路径在哪里设置?

[复制链接]
  • TA的每日心情
    叹气
    2020-7-22 18:26
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]初来乍到

    4

    主题

    11

    帖子

    30

    积分

    Rank: 1

    积分
    30
    发表于 2020-7-23 18:01:10 | 显示全部楼层 |阅读模式

    51Halcon诚邀您的加入,专注于机器视觉开发与应用技术,我们一直都在努力!

    您需要 登录 才可以下载或查看,没有帐号?会员注册

    x
    本帖最后由 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', [], [])
    复制代码

    1.发帖求助前要善用论坛搜索功能,那里可能会有你要找的答案;

    2.提问请组织好自己的逻辑,标题注明大概是什么问题,问题内容写详细,需提供问题症状、错误代码、截图、位置等等信息,不要让别人去猜你想问啥;

    3.如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子分类或者标题前面加上【已解决】

    4.回报帮助你解决问题的坛友,右下角【免费评分】赠与对方视觉币和热心值,伸手党遭人唾弃,做一个热心并受欢迎的人!

  • TA的每日心情
    耍酷
    昨天 16:39
  • 签到天数: 991 天

    连续签到: 3 天

    [LV.10]以坛为家III

    386

    主题

    1564

    帖子

    7486

    积分

    Rank: 9

    积分
    7486

    突出贡献优秀版主荣誉管理论坛元老切换助手验证会员最佳新人

    发表于 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
    无效附件更新 权限提升操作 删帖申请 举报以及其他需要帮助请加入QQ群:214663141 广告位招商 有意者联系
  • TA的每日心情
    叹气
    2020-7-22 18:26
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]初来乍到

    4

    主题

    11

    帖子

    30

    积分

    Rank: 1

    积分
    30
     楼主| 发表于 2020-7-27 11:25:12 | 显示全部楼层
    Criss 发表于 2020-7-23 18:34
    你说的是acquire_camera_images_deflectometry算子里面出现的图片么?
    图片属于HALCON配置的默认图片目录下 ...

    谢谢

    1.发帖求助前要善用论坛搜索功能,那里可能会有你要找的答案;

    2.提问请组织好自己的逻辑,标题注明大概是什么问题,问题内容写详细,需提供问题症状、错误代码、截图、位置等等信息,不要让别人去猜你想问啥;

    3.如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子分类或者标题前面加上【已解决】

    4.回报帮助你解决问题的坛友,右下角【免费评分】赠与对方视觉币和热心值,伸手党遭人唾弃,做一个热心并受欢迎的人!

    您需要登录后才可以回帖 会员登录 | 会员注册

    本版积分规则

    建议您使用Chrome、Firefox、Edge、IE10及以上版本和360等主流浏览器浏览本网站

    51Halcon会员技术交流会员技术交流 | 51Halcon官方客服咨询官方客服咨询 | Halcon切换助手使用反馈切换助手使用

    申请友链| 小黑屋| 手机版| Archiver| 有问题需要咨询站长?|  

    CopyRight © 2015-2020 51Halcon机器视觉. Version X3.4.

    粤ICP备15095995号-2 粤公网安备44030602000670号

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