在halcon中,对图像操作时,时常还得针对窗口进行设置等,
图像是在窗口中显示,所以时常要设置窗口属性以满足图像处理结果显示。
这里我们接着介绍窗口相关函数。
open_window close_window clear_window
get_window_extents set_window_extents dump_window
dump_window_image flush_buffer copy_rectangle
query_window_type get_window_type set_window_type
get_window_attr set_window_attr
update_window_pose unproject_coordinates
get_disp_object_model_3d_info
get_os_window_handle get_window_pointer3
set_window_dc new_extern_window
工业视觉 halcon图形window函数详细介绍
如下,我们也在halcon中运行,查看效果:
实例:
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
read_image (Image, 'printer_chip/printer_chip_01')
dev_display (Image)
dev_clear_window ()
get_window_extents (WindowHandle, Row, Column, Width, Height)
dev_set_window_extents (0, 0, 200, 200)
dev_set_paint ('3d_plot')
dev_display (Image)
dump_window (WindowHandle, 'png', '123')
dump_window_image (Image1, WindowHandle)
dev_set_paint ('default')
dev_clear_window ()
dev_display (Image1)
dev_clear_window ()
set_window_param (WindowHandle, 'flush', 'false')
dev_display (Image)
flush_buffer (WindowHandle)
set_window_param (WindowHandle, 'flush', 'true')
dev_clear_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle1)
dev_set_window (WindowHandle)
dev_display (Image)
draw_rectangle1 (WindowHandle, Row1, Column1, Row2, Column2)
copy_rectangle (WindowHandle, WindowHandle1, Row1, Column1, Row2, Column2, 0, 0)
query_window_type (WindowTypes)
get_window_type (WindowHandle1, WindowType)
set_window_type ('WIN32-Window')
get_window_attr ('background_color', AttributeValue)
set_window_attr ('window_title', 'gkbc8.com')
open_window (Row1, Column1, Width, Height, 0, 'visible', '', WindowHandle2)
close_window (WindowHandle2)
dev_set_window (WindowHandle1)
dev_set_paint ('3d_plot')
dev_display (Image1)
update_window_pose (WindowHandle1, 97, 61, 122, 131, 'rotate')
dev_display (Image1)
unproject_coordinates (Image1, WindowHandle1, 104, 62, ImageRow, ImageColumn, Height1)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle3)
gen_cam_par_area_scan_division (0.025, 0, 1.1e-05, 1.1e-05, 384.0, 288.0, 768, 576, CameraParam)
create_pose (-0.037, 0.026, 0.42, 137, 52, 326, 'Rp+T', 'gba', 'point', Pose1)
read_object_model_3d ('pipe_joint', 'm', 'convert_to_triangles', 'true', PipeJointOM3DID, Status)
disp_object_model_3d (WindowHandle3, PipeJointOM3DID, CameraParam, Pose1, 'object_index_persistence', 'true')
get_disp_object_model_3d_info (WindowHandle3, 377, 211, 'object_index', Value)
*new_extern_window (WindowHandle4, Row1, Column1, Width, Height, WindowHandle4)
*set_window_dc (WindowHandle3,WindowHandle4 )
*get_os_window_handle (WindowHandle3, OSWindowHandle, OSDisplayHandle)
get_image_pointer3 (Image1, PointerRed, PointerGreen, PointerBlue, Type, Width2, Height3)
set_window_type ('pixmap')
get_window_pointer3 (WindowHandle3, ImageRed, ImageGreen, ImageBlue, Width1, Height2)
帖子为视频教程部分内容,
可以下载下面的教程学习。
上位机VC MFC程序开发精典实例大全源码与视频讲解配套下载408例 经历1年的编程与录制点击进入查看
如果您认可,可联系功能定制! 如果您着急,充值会员可直接联系发您资料!
|