工控编程吧

标题: 工业视觉halcon图形object函数详细介绍 [打印本页]

作者: qq263946146    时间: 2019-11-6 12:42
标题: 工业视觉halcon图形object函数详细介绍

图形对象可以是图像,区域或XLD形式,HALCON额外提供有很多函数与用户交互工作。
实现对图形对象的操作,然后再将操作的图形对象在后续中使用。
这些函数有:
attach_background_to_window  get_window_background_image
detach_background_from_window
create_drawing_object_circle  create_drawing_object_circle_sector
create_drawing_object_ellipse  create_drawing_object_ellipse_sector
create_drawing_object_line  create_drawing_object_rectangle1
create_drawing_object_rectangle2  create_drawing_object_text
create_drawing_object_xld  attach_drawing_object_to_window
detach_drawing_object_from_window  get_drawing_object_iconic
set_drawing_object_params  get_drawing_object_params
set_drawing_object_xld  clear_drawing_object
set_content_update_callback
set_drawing_object_callback

实例
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
read_image(ImageGB, '1.jpg')
dev_clear_window ()
attach_background_to_window (ImageGB,WindowHandle )
read_image (Image, 'printer_chip/printer_chip_01')
dev_display (Image)
dev_clear_obj (Image)
dev_clear_window ()
get_window_background_image (BackgroundImage, WindowHandle)
detach_background_from_window (WindowHandle)
create_drawing_object_circle (100, 100, 80, DrawID)
create_drawing_object_circle_sector (100, 100, 80, 0, 3.14159, DrawID1)
create_drawing_object_ellipse (200, 200, 0, 100, 60, DrawID2)
create_drawing_object_ellipse_sector (200, 200, 0, 100, 60, 0, 3.14159, DrawID3)
create_drawing_object_line (100, 100, 200, 200, DrawID4)
create_drawing_object_rectangle1 (100, 100, 200, 200, DrawID5)
create_drawing_object_rectangle2 (150, 150, 0, 100, 100, DrawID6)
create_drawing_object_text (12, 12, 'Text', DrawID7)
create_drawing_object_xld ([100,200,200,100], [100,100,200,200], DrawID8)

attach_drawing_object_to_window (WindowHandle, DrawID1)
detach_drawing_object_from_window (WindowHandle, DrawID1)

get_drawing_object_iconic (Object, DrawID1)
gen_cross_contour_xld (Cross, 500, 500, 100, 0.785398)
set_drawing_object_xld (Cross, DrawID8)
attach_drawing_object_to_window (WindowHandle, DrawID8)

set_drawing_object_params (DrawID1, 'color', 'green')
get_drawing_object_params (DrawID1, 'color', GenParamValue)

detach_drawing_object_from_window (WindowHandle, DrawID1)
clear_drawing_object (DrawID1)
帖子为视频教程部分内容,
可以下载教程学习。
[halcon]1[/halcon]
[MFC408]1[/MFC408]
[weixinlianxi]1[/weixinlianxi]








欢迎光临 工控编程吧 (https://www.gkbc8.com/) Powered by Discuz! X3.4