淘先锋技术网

首页 1 2 3 4 5 6 7

《zw版·Halcon-delphi系列原创教程》 3d汽车模型自动区域分割

目前,图像分析,在3D设计,机器视觉方面拥有很广。
这个Halcon脚本是3d汽车模型自动区域分割,很简单才20多行。

ps,有兴趣的网友,可以自己改为delphi、vc、vb版时间,其实opencv版本的也不难,不过代码应该不低于200行,由此可见Halcon的彪悍

 1 * Prepare windows
 2 dev_update_off ()
 3 dev_close_window ()
 4 dev_open_window (0, 0, 512, 512, 'black', WindowHandle1)
 5 dev_open_window (0, 512, 512, 512, 'black', WindowHandle2)
 6 set_display_font (WindowHandle1, 16, 'mono', 'true', 'false')
 7 set_display_font (WindowHandle2, 16, 'mono', 'true', 'false')
 8 * Read 3D object model
 9 read_object_model_3d ('bmc_mini', 'm', [], [], ObjectModel3D, Status)
10 * 
11 * Calculate the connected components based on the mesh
12 * information. The parameter 'Value' is ignored for the
13 * feature 'mesh'.
14 connection_object_model_3d (ObjectModel3D, 'mesh', 1, ObjectModel3DConnected)
15 * 
16 * Display the object model 3D
17 Pose := [0.08,0.05,1.0,188.0,50.0,0.0,0]
18 CamParam := [0.01,0,7e-6,7e-6,256,240,512,512]
19 disp_object_model_3d_safe (WindowHandle1, ObjectModel3D, CamParam, Pose, 'colored', 12)
20 disp_object_model_3d_safe (WindowHandle2, ObjectModel3DConnected, CamParam, Pose, 'colored', 12)
21 disp_message (WindowHandle1, 'The complete model', 'window', 12, 12, 'black', 'true')
22 disp_message (WindowHandle2, 'The connected components', 'window', 12, 12, 'black', 'true')
23 clear_object_model_3d ([ObjectModel3D,ObjectModel3DConnected])

 



【《zw版·Halcon-delphi系列原创教程》,网址,cnblogs.com/ziwang/】

转载于:https://www.cnblogs.com/ziwang/p/4856774.html