HALCON 杂记
1.emphasize — Enhance contrast of the image. 增强图像对比度
emphasize(Image : ImageEmphasize : MaskWidth, MaskHeight, Factor : )
read_image(Image,'mreut') dev_display (Image)
*手动划区域 draw_region(Region,WindowHandle) reduce_domain(Image,Region,Mask) emphasize(Mask,Sharp,7,7,2.0) dev_display (Sharp)
2.draw_region — Interactive drawing of a closed region 手动画一个封闭任意区域
3.set_rgb( : : WindowHandle, Red, Green, Blue : ) rgb值来设置颜色
4.harmonic_interpolation — Perform a harmonic interpolation on an image region.
5.gen_binocular_rectification_map -----Generate transformation maps that describe the mapping of the images of a binocular camera pair to a common rectified image plane.
* Set internal and external stereo parameters. * Note that, typically, these values are the result of a prior * calibration. gen_cam_par_area_scan_division (0.01, -665, 5.2e-006, 5.2e-006, \ 622, 517, 1280, 1024, CamParam1) gen_cam_par_area_scan_division (0.01, -731, 5.2e-006, 5.2e-006, \ 654, 519, 1280, 1024, CamParam2) create_pose (0.1535,-0.0037,0.0447,0.17,319.84,359.89, \ 'Rp+T', 'gba', 'point', RelPose) * Compute the mapping for rectified images. gen_binocular_rectification_map (Map1, Map2, CamParam1, CamParam2, \ RelPose, 1,'viewing_direction', 'bilinear',\ CamParamRect1, CamParamRect2, \ CamPoseRect1, CamPoseRect2, \ RelPoseRect) * Compute the disparities in online images. while (1) grab_image_async (Image1, AcqHandle1, -1) map_image (Image1, Map1, ImageMapped1) grab_image_async (Image2, AcqHandle2, -1) map_image (Image2, Map2, ImageMapped2) binocular_disparity(ImageMapped1, ImageMapped2, Disparity, Score, \ 'sad', 11, 11, 20, -40, 20, 2, 25, \ 'left_right_check', 'interpolation') endwhile
6.binocular_disparity — Compute the disparities of a rectified image pair using correlation techniques.
7.binocular_distance — Compute the distance values for a rectified stereo image pair using correlation techniques.
使用相关技术计算校正立体图像对的距离值。
8.disparity_image_to_xyz — Transform a disparity image into 3D points in a rectified stereo system.
将视差图像转换为校正立体系统中的 3D 点。
9.xyz_attrib_to_object_model_3d — Transform 3D points from images to a 3D object model, and add extended attributes to the points of the object model.
将 3D 点从图像转换为 3D 对象模型,并向对象模型的点添加扩展属性。
xyz_attrib_to_object_model_3d (X, Y, Z, ImageRGB, ['&red', '&green', '&blue'], ObjectModel3D) prepare_object_model_3d (ObjectModel3D, 'segmentation', 'true', [], []) visualize_object_model_3d (WindowHandle, ObjectModel3D, [], [], ['red_channel_attrib', 'green_channel_attrib', 'blue_channel_attrib'], ['&red', '&green', '&blue'], [], [], [], PoseOut)
10.prepare_object_model_3d — Prepare a 3D object model for a certain operation.
* This example program shows the usage of the procedure * xyz_attrib_to_object_model_3d. * It can be used to create 3D object models from X, Y and Z images, * and simultaneously attach attributes to every point. * * Initialization dev_update_off () dev_close_window () * * Read the digital surface model. read_image (Z, 'mreut_dgm_2.0.tif') get_image_size (Z, Width, Height) * * Read image that contains the gray values that will be added * to the 3D object model as attribute. read_image (AerialImage, 'mreut4_3.png') * * Generate a label image with a second attribute. * In this case, we label different terrain types very simply, * just for demonstration purposes. auto_threshold (AerialImage, Regions, 4) region_to_label (Regions, LabelImage, 'byte', Width, Height) * * Create a multichannel image from both attribute images. compose2 (AerialImage, LabelImage, MultiChannelAttribImage) * * Create images that contain X and Y coordinates in a regular grid. * For a simple gray ramp, the input parameters of * gen_image_surface_first_order are very simple: GroundResolution := 2.0 gen_image_surface_first_order (X, 'real', 0, GroundResolution, 0, 0, 0, Width, Height) gen_image_surface_first_order (Y, 'real', -GroundResolution, 0, 0, 0, 0, Width, Height) * * The following procedure creates a 3D object model from * the X, Y and Z image and adds the information contained * in the attribute image to each point. AttribName := ['&gray','&terrain'] xyz_attrib_to_object_model_3d (X, Y, Z, MultiChannelAttribImage, AttribName, ObjectModel3D) * * Display results * dev_open_window (Height / 2, 0, Width / 2, Height / 2, 'black', WindowHandle1) dev_set_part (0, 0, Height - 1, Width - 1) set_display_font (WindowHandle1, 16, 'mono', 'true', 'false') dev_set_color (['red','green','blue']) dev_set_draw ('fill') dev_display (Regions) disp_message (WindowHandle1, 'Terrain types', 'window', 12, 12, 'black', 'true') * dev_open_window (0, 0, Width / 2, Height / 2, 'black', WindowHandle2) set_display_font (WindowHandle2, 16, 'mono', 'true', 'false') dev_display (AerialImage) disp_message (WindowHandle2, 'Aerial image', 'window', 12, 12, 'black', 'true') * dev_open_window (0, Width / 2 + 8, Width, Height, 'gray', WindowHandle3) set_display_font (WindowHandle3, 16, 'mono', 'true', 'false') dev_display (Z) * disp_message (WindowHandle3, 'Digital surface model', 'window', 12, 12, 'black', 'true') disp_continue_message (WindowHandle3, 'black', 'true') stop () * * Perform fast triangulation of the object model for better visualization. prepare_object_model_3d (ObjectModel3D, 'segmentation', 'true', [], []) * Visualize 3d object model interactively create_pose (-620, -85, 17000, 135, 2, 10, 'Rp+T', 'gba', 'point', Pose) Instructions := 'Rotate: Left button' Instructions[1] := 'Zoom: Shift + left button' Instructions[2] := 'Move: Ctrl + left button' visualize_object_model_3d (WindowHandle3, ObjectModel3D, [], Pose, ['color_attrib','color_attrib_start','color_attrib_end'], ['&gray',0,255], ['Created 3D model','Attribute used for visualization: \'&gray\''], [], Instructions, PoseOut) visualize_object_model_3d (WindowHandle3, ObjectModel3D, [], PoseOut, ['color_attrib','lut'], ['&terrain','color1'], ['Created 3D model','Attribute used for visualization: \'&terrain\''], [], Instructions, PoseOut) disp_end_of_program_message (WindowHandle3, 'black', 'true')
11.get_domain — Get the domain of an image. 输入图像转为一个区域
The operator get_domain returns the definition domains of all input images as a region.
12.complement — Return the complement of a region. 返回一个区域的补集
13.full_domain — Expand the domain of an image to maximum.
将映像的域扩展到最大
------------------------------------
承接
**视觉检测软件开发及调试
**工业软件开发
**上位机软件开发
wechat:luoran2024
qq:565934058
email:taoyuansu@qq.com
海量教育资源及影视资源下载
微信公众号:EFun科技
------------------------------------
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!