基于Halcon学习的set_window_param算子

*禁用自动刷新窗口以实现无闪烁显示
set_window_param (WindowHandle, 'flush', 'false')

在显示每一个对象之后是否刷新窗口。如果该值设置为false,必须调用FlushBuffer函数刷新窗口。
如果需要与窗口进行交互(缩放与拖拽),则必须色设置该值为true

参数:

General window parameters:
'flush'(true/false)
在显示每一个对象之后是否刷新窗口。如果该值设置为false,必须调用FlushBuffer函数刷新窗口。
如果需要与窗口进行交互(缩放与拖拽),则必须色设置该值为true

'region_quality'(good/low)
影响区域对象的渲染质量。该值设置为good,区域对象显示更精确且友好;该值设置为low,
区域对象显示有些不精确但速度快。如果区域的标间模式设置为margin,则部分边缘可能无法正常显示。

'background_color'(black)
设置窗口的背景色,ClearWindow函数使用该颜色清除窗口内容

'window_title'
允许修改窗口的标题,最高1023个字符

'anti_aliasing'(true/false)
是否开启窗口显示区域与轮廓的反欠采样噪声功能

'graphics_stack'(true/false)
开启或关闭窗口的图形堆栈功能。在激活图形堆栈的窗口中调用SetPart改变窗口的显示区域将
使用新的显示区域显示原先显示的对象。开启该功能能够实现窗口内容的移动与缩放。
该参数对HDevelop 图形窗口无效

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
* This example shows how to use shape-based matching * in order to find a model region and use it for * further tasks. * Here, the additional task consists of reading text * within a certain region, wherefore the image has * to be aliged using the matching transformation. * * Initialization. dev_update_window ('off') dev_close_window () * Initialize visualization. read_image (ReferenceImage, 'board/board_01') get_image_size (ReferenceImage, Width, Height) initialize_visualization (Width / 2, Height / 2, WindowHandle, WindowHandleText) disp_continue_message (WindowHandle, 'black', 'true') disp_description_text (WindowHandleText) * * Define ROIs: * ROI for the shape model. dev_set_window (WindowHandle) dev_display (ReferenceImage) gen_rectangle1 (ROIModel, 60, 535, 185, 900) dev_display (ROIModel) * ROI for the text. gen_rectangle1 (ROIText, 445, 585, 590, 765) dev_display (ROIText) disp_model_message (WindowHandle) stop () * * Prepare the shape-based matching model. reduce_domain (ReferenceImage, ROIModel, ModelImage) * Create shape model and set parameters (offline step). create_generic_shape_model (ModelHandle) * Train the shape model. train_generic_shape_model (ModelImage, ModelHandle) * * Prepare the text model. create_text_model_reader ('auto', 'Industrial_0-9A-Z_Rej.omc', TextModel) * * We look for the reference transformation which we will need * for the alignment. We can extract it by finding the instance * on the reference image. * Set find parameters. set_generic_shape_model_param (ModelHandle, 'num_matches', 1) set_generic_shape_model_param (ModelHandle, 'min_score', 0.5) find_generic_shape_model (ReferenceImage, ModelHandle, MatchResultID, Matches) get_generic_shape_model_result (MatchResultID, 'all', 'hom_mat_2d', HomMat2DModel) * * Find the object in other images (online step). for i := 1 to 9 by 1 read_image (SearchImage, 'board/board_' + i$'02') find_generic_shape_model (SearchImage, ModelHandle, MatchResultID, Matches) get_generic_shape_model_result (MatchResultID, 'all', 'hom_mat_2d', HomMat2DMatch) * Compute the transformation matrix. hom_mat2d_invert (HomMat2DMatch, HomMat2DMatchInvert) hom_mat2d_compose (HomMat2DModel, HomMat2DMatchInvert, TransformationMatrix) affine_trans_image (SearchImage, ImageAffineTrans, TransformationMatrix, 'constant', 'false') * * Visualization. dev_set_window (WindowHandle) dev_display (SearchImage) get_generic_shape_model_result_object (InstanceObject, MatchResultID, 'all', 'contours') dev_display (InstanceObject) * * Reading text and numbers on the aligned image. reduce_domain (ImageAffineTrans, ROIText, ImageOCR) find_text (ImageOCR, TextModel, TextResultID) get_text_object (Characters, TextResultID, 'all_lines') get_text_result (TextResultID, 'class', RecognizedText) * * Visualization. dev_set_window (WindowHandleText) dev_display (ImageAffineTrans) dev_set_colored (12) dev_display (Characters) disp_finding_text (Characters, WindowHandle, WindowHandleText, RecognizedText) wait_seconds (0.5) endfor disp_end_of_program_message (WindowHandle, 'black', 'true') stop () dev_close_window ()
06-02

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值