halcon程序安装破解与VC6.0结合

编程入门 行业动态 更新时间:2024-10-22 16:32:10

halcon<a href=https://www.elefans.com/category/jswz/34/1771429.html style=程序安装破解与VC6.0结合"/>

halcon程序安装破解与VC6.0结合

转载:

HALCON是德国MVtec公司开发的一套完善的标准的机器视觉算法包,拥有应用广泛的机器视觉集成开发环境 。它节约了产品成本,缩短了软件开发周期——HALCON灵活的架构便于机器视觉,医学图像和图像分析应用的快速开发。在欧洲以及日本的工业界已经是公认具有最佳效能的Machine Vision软件。

HALCON源自学术界,它有别于市面一般的商用软件包。事实上,这是一套image processing library,由一千多个各自独立的函数,以及底层的数据管理核心构成。其中包含了各类滤波,色彩以及几何,数学转换,型态学计算分析,校正,分类辨识,形状搜寻等等基本的几何以及影像计算功能,由于这些功能大多并非针对特定工作设计的,因此只要用得到图像处理的地方,就可以用HALCON强大的计算 分析能力来完成工作。应用范围几乎没有限制,涵盖医学,遥感探测,监控,到工业上的各类自动化检测。

HALCON支持Windows,Linux和Mac OS X操作环境,它保证了投资的有效性。整个函数库可以用C,C++,C#,Visual basic和Delphi等多种普通编程语言访问。HALCON为大量的图像获取设备提供接口,保证了硬件的独立性。它为百余种工业相机和图像采集卡提供接口,包括GenlCam,GigE和IIDC 1394。

HALCON功能:

1.技术革新 HALCON 11可以实现真正意义上的目标识别。基于样本的识别方法可以区分出数量巨大的目标对象。使用这种技术可以实现仅依靠颜色或纹理等特征即可识别经过训练的目标,从而无需再采用一维码或二维码等用于目标识别的特殊印记。 2.强大的三维视觉处理 HALCON 11提供的一个极为突出的新技术是三维表面比较,即将一个三维物体的表面形状测量结果与预期形状进行比较。HALCON提供的所有三维技术,如多目立体视觉或sheet of light,都可用于表面重构;同时也支持直接通过现成的三维硬件扫描仪进行三维重构。此外,针对表面检测中的特殊应用对光度立体视觉方法进行了改善。不仅如此,HALCON现在还支持许多三维目标处理的方法,如点云的计算和三角测量、形状和体积等特征计算、通过切面进行点云分割等。 3.高速机器视觉体验 自动算子并行处理 (AOP) 技术是HALCON的一个独特性能。HALCON 11中支持使用GPU处理进行机器视觉算法的算子超过75个,比其他任何软件开发包提供的数量都多。除此之外,基于聚焦变化的深度图像获取 (depth from focus)、快速傅立叶变换 (FFT) 和HALCON的局部变形匹配都有显著的加速。HALCON 11会带给用户更高速的机器视觉体验。 4.其他新功能
1)Aztec码识别; 2)Micro QR码识别; 3)为分类自动选择特征;
4)使用HDevelop性能评测工具进行高效的编码分析; 5)支持Mac OS X 10.7操作系统; 6)重新修订HALCON/C++接口;
7)三维数据快速可视化; 8)远心镜头立体视觉; 9)改善摄像机标定技术;
10)HDevelop OCR助手,包含训练文件浏览器; 11)用于一维码和二维码识别的GS1术语学; 12)串行化HALCON/.NET及HALCON/C++;
13)易用的测量工具; 14)支持JPEG XR及其他。
好啦以上就是 HALCON的介绍现在开始介绍安装: 第一步:安装前准备
第二步:


第三步:破解

将其复制到安装目录下的license目录下

双击激活工具


然后


ok啦!!!

启动界面如下:



和VC6.0结合


第一步:将程序导出并保存为:.cpp文件


如下代码:

[cpp]  view plain copy
  1. <pre name="code" class="cpp">///  
  2. //  File generated by HDevelop for HALCON/C++ Version 10.0  
  3. ///  
  4.   
  5.   
  6.   
  7. #include "HalconCpp.h"  
  8.   
  9.   
  10.   
  11. using namespace Halcon;  
  12.   
  13. // Default exception handler   
  14. void CPPExpDefaultExceptionHandler(const Halcon::HException& except)  
  15. {  
  16.   throw except;  
  17. }  
  18.   
  19. // Procedure declarations   
  20. // External procedures   
  21. // Chapter: Graphics / Text  
  22. // Short Description: This procedure displays 'Click 'Run' to continue' in the lower right corner of the screen.  
  23. void disp_continue_message (Halcon::HTuple WindowHandle, Halcon::HTuple Color, Halcon::HTuple Box);  
  24. // Chapter: Graphics / Text  
  25. // Short Description: This procedure writes a text message.  
  26. void disp_message (Halcon::HTuple WindowHandle, Halcon::HTuple String, Halcon::HTuple CoordSystem,   
  27.     Halcon::HTuple Row, Halcon::HTuple Column, Halcon::HTuple Color, Halcon::HTuple Box);  
  28. // Chapter: Graphics / Text  
  29. // Short Description: Set font independent of OS  
  30. void set_display_font (Halcon::HTuple WindowHandle, Halcon::HTuple Size, Halcon::HTuple Font,   
  31.     Halcon::HTuple Bold, Halcon::HTuple Slant);  
  32.   
  33. // Procedures   
  34. // External procedures   
  35. // Chapter: Graphics / Text  
  36. // Short Description: This procedure displays 'Click 'Run' to continue' in the lower right corner of the screen.  
  37. void disp_continue_message (Halcon::HTuple WindowHandle, Halcon::HTuple Color, Halcon::HTuple Box)  
  38. {  
  39.   using namespace Halcon;  
  40.   
  41.   // Local control variables   
  42.   HTuple  ContinueMessage, Row, Column, Width, Height;  
  43.   HTuple  Ascent, Descent, TextWidth, TextHeight;  
  44.   
  45.   //This procedure displays 'Press Run (F5) to continue' in the  
  46.   //lower right corner of the screen.  
  47.   //It uses the procedure disp_message.  
  48.   //  
  49.   //Input parameters:  
  50.   //WindowHandle: The window, where the text shall be displayed  
  51.   //Color: defines the text color.  
  52.   //   If set to '' or 'auto', the currently set color is used.  
  53.   //Box: If set to 'true', the text is displayed in a box.  
  54.   //  
  55.   ContinueMessage = "Press Run (F5) to continue";  
  56.   get_window_extents(WindowHandle, &Row, &Column, &Width, &Height);  
  57.   get_string_extents(WindowHandle, (" "+ContinueMessage)+" ", &Ascent, &Descent,   
  58.       &TextWidth, &TextHeight);  
  59.   disp_message(WindowHandle, ContinueMessage, "window", (Height-TextHeight)-12, (Width-TextWidth)-12,   
  60.       Color, Box);  
  61.   return;  
  62. }  
  63.   
  64. // Chapter: Graphics / Text  
  65. // Short Description: This procedure writes a text message.  
  66. void disp_message (Halcon::HTuple WindowHandle, Halcon::HTuple String, Halcon::HTuple CoordSystem,   
  67.     Halcon::HTuple Row, Halcon::HTuple Column, Halcon::HTuple Color, Halcon::HTuple Box)  
  68. {  
  69.   using namespace Halcon;  
  70.   
  71.   // Local control variables   
  72.   HTuple  Red, Green, Blue, Row1Part, Column1Part;  
  73.   HTuple  Row2Part, Column2Part, RowWin, ColumnWin, WidthWin;  
  74.   HTuple  HeightWin, MaxAscent, MaxDescent, MaxWidth, MaxHeight;  
  75.   HTuple  R1, C1, FactorRow, FactorColumn, Width, Index, Ascent;  
  76.   HTuple  Descent, W, H, FrameHeight, FrameWidth, R2, C2;  
  77.   HTuple  DrawMode, Exception, CurrentColor;  
  78.   
  79.   
  80.   // Install default exception handler   
  81.   HException::InstallHHandler(&CPPExpDefaultExceptionHandler);  
  82.   
  83.   //This procedure displays text in a graphics window.  
  84.   //  
  85.   //Input parameters:  
  86.   //WindowHandle: The WindowHandle of the graphics window, where  
  87.   //   the message should be displayed  
  88.   //String: A tuple of strings containing the text message to be displayed  
  89.   //CoordSystem: If set to 'window', the text position is given  
  90.   //   with respect to the window coordinate system.  
  91.   //   If set to 'image', image coordinates are used.  
  92.   //   (This may be useful in zoomed images.)  
  93.   //Row: The row coordinate of the desired text position  
  94.   //   If set to -1, a default value of 12 is used.  
  95.   //Column: The column coordinate of the desired text position  
  96.   //   If set to -1, a default value of 12 is used.  
  97.   //Color: defines the color of the text as string.  
  98.   //   If set to [], '' or 'auto' the currently set color is used.  
  99.   //   If a tuple of strings is passed, the colors are used cyclically  
  100.   //   for each new textline.  
  101.   //Box: If set to 'true', the text is written within a white box.  
  102.   //  
  103.   //prepare window  
  104.   get_rgb(WindowHandle, &Red, &Green, &Blue);  
  105.   get_part(WindowHandle, &Row1Part, &Column1Part, &Row2Part, &Column2Part);  
  106.   get_window_extents(WindowHandle, &RowWin, &ColumnWin, &WidthWin, &HeightWin);  
  107.   set_part(WindowHandle, 0, 0, HeightWin-1, WidthWin-1);  
  108.   //  
  109.   //default settings  
  110.   if (0 != (Row==-1))  
  111.   {  
  112.     Row = 12;  
  113.   }  
  114.   if (0 != (Column==-1))  
  115.   {  
  116.     Column = 12;  
  117.   }  
  118.   if (0 != (Color==HTuple()))  
  119.   {  
  120.     Color = "";  
  121.   }  
  122.   //  
  123.   String = ((""+String)+"").Split("\n");  
  124.   //  
  125.   //Estimate extentions of text depending on font size.  
  126.   get_font_extents(WindowHandle, &MaxAscent, &MaxDescent, &MaxWidth, &MaxHeight);  
  127.   if (0 != (CoordSystem==HTuple("window")))  
  128.   {  
  129.     R1 = Row;  
  130.     C1 = Column;  
  131.   }  
  132.   else  
  133.   {  
  134.     //transform image to window coordinates  
  135.     FactorRow = (1.0*HeightWin)/((Row2Part-Row1Part)+1);  
  136.     FactorColumn = (1.0*WidthWin)/((Column2Part-Column1Part)+1);  
  137.     R1 = ((Row-Row1Part)+0.5)*FactorRow;  
  138.     C1 = ((Column-Column1Part)+0.5)*FactorColumn;  
  139.   }  
  140.   //  
  141.   //display text box depending on text size  
  142.   if (0 != (Box==HTuple("true")))  
  143.   {  
  144.     //calculate box extents  
  145.     String = (" "+String)+" ";  
  146.     Width = HTuple();  
  147.     for (Index=0; Index<=(String.Num())-1; Index+=1)  
  148.     {  
  149.       get_string_extents(WindowHandle, HTuple(String[Index]), &Ascent, &Descent,   
  150.           &W, &H);  
  151.       Width.Append(W);  
  152.     }  
  153.     FrameHeight = MaxHeight*(String.Num());  
  154.     FrameWidth = (HTuple(0).Concat(Width)).Max();  
  155.     R2 = R1+FrameHeight;  
  156.     C2 = C1+FrameWidth;  
  157.     //display rectangles  
  158.     get_draw(WindowHandle, &DrawMode);  
  159.     set_draw(WindowHandle, "fill");  
  160.     set_color(WindowHandle, "light gray");  
  161.     disp_rectangle1(WindowHandle, R1+3, C1+3, R2+3, C2+3);  
  162.     set_color(WindowHandle, "white");  
  163.     disp_rectangle1(WindowHandle, R1, C1, R2, C2);  
  164.     set_draw(WindowHandle, DrawMode);  
  165.   }  
  166.   else if (0 != (Box!=HTuple("false")))  
  167.   {  
  168.     Exception = "Wrong value of control parameter Box";  
  169.     throw HException(Exception);  
  170.   }  
  171.   //Write text.  
  172.   for (Index=0; Index<=(String.Num())-1; Index+=1)  
  173.   {  
  174.     CurrentColor = Color[Index%(Color.Num())];  
  175.     if (0 != (HTuple(CurrentColor!=HTuple("")).And(CurrentColor!=HTuple("auto"))))  
  176.     {  
  177.       set_color(WindowHandle, CurrentColor);  
  178.     }  
  179.     else  
  180.     {  
  181.       set_rgb(WindowHandle, Red, Green, Blue);  
  182.     }  
  183.     Row = R1+(MaxHeight*Index);  
  184.     set_tposition(WindowHandle, Row, C1);  
  185.     write_string(WindowHandle, HTuple(String[Index]));  
  186.   }  
  187.   //reset changed window settings  
  188.   set_rgb(WindowHandle, Red, Green, Blue);  
  189.   set_part(WindowHandle, Row1Part, Column1Part, Row2Part, Column2Part);  
  190.   return;  
  191. }  
  192.   
  193. // Chapter: Graphics / Text  
  194. // Short Description: Set font independent of OS  
  195. void set_display_font (Halcon::HTuple WindowHandle, Halcon::HTuple Size, Halcon::HTuple Font,   
  196.     Halcon::HTuple Bold, Halcon::HTuple Slant)  
  197. {  
  198.   using namespace Halcon;  
  199.   
  200.   // Local control variables   
  201.   HTuple  OS, Exception, AllowedFontSizes, Distances;  
  202.   HTuple  Indices;  
  203.   
  204.   
  205.   // Install default exception handler   
  206.   HException::InstallHHandler(&CPPExpDefaultExceptionHandler);  
  207.   
  208.   //This procedure sets the text font of the current window with  
  209.   //the specified attributes.  
  210.   //It is assumed that following fonts are installed on the system:  
  211.   //Windows: Courier New, Arial Times New Roman  
  212.   //Linux: courier, helvetica, times  
  213.   //Because fonts are displayed smaller on Linux than on Windows,  
  214.   //a scaling factor of 1.25 is used the get comparable results.  
  215.   //For Linux, only a limited number of font sizes is supported,  
  216.   //to get comparable results, it is recommended to use one of the  
  217.   //following sizes: 9, 11, 14, 16, 20, 27  
  218.   //(which will be mapped internally on Linux systems to 11, 14, 17, 20, 25, 34)  
  219.   //  
  220.   //input parameters:  
  221.   //WindowHandle: The graphics window for which the font will be set  
  222.   //Size: The font size. If Size=-1, the default of 16 is used.  
  223.   //Bold: If set to 'true', a bold font is used  
  224.   //Slant: If set to 'true', a slanted font is used  
  225.   //  
  226.   get_system("operating_system", &OS);  
  227.   if (0 != (HTuple(Size==HTuple()).Or(Size==-1)))  
  228.   {  
  229.     Size = 16;  
  230.   }  
  231.   if (0 != ((OS.Substring(0,2))==HTuple("Win")))  
  232.   {  
  233.     //set font on Windows systems  
  234.     if (0 != (HTuple(HTuple(Font==HTuple("mono")).Or(Font==HTuple("Courier"))).Or(Font==HTuple("courier"))))  
  235.     {  
  236.       Font = "Courier New";  
  237.     }  
  238.     else if (0 != (Font==HTuple("sans")))  
  239.     {  
  240.       Font = "Arial";  
  241.     }  
  242.     else if (0 != (Font==HTuple("serif")))  
  243.     {  
  244.       Font = "Times New Roman";  
  245.     }  
  246.     if (0 != (Bold==HTuple("true")))  
  247.     {  
  248.       Bold = 1;  
  249.     }  
  250.     else if (0 != (Bold==HTuple("false")))  
  251.     {  
  252.       Bold = 0;  
  253.     }  
  254.     else  
  255.     {  
  256.       Exception = "Wrong value of control parameter Bold";  
  257.       throw HException(Exception);  
  258.     }  
  259.     if (0 != (Slant==HTuple("true")))  
  260.     {  
  261.       Slant = 1;  
  262.     }  
  263.     else if (0 != (Slant==HTuple("false")))  
  264.     {  
  265.       Slant = 0;  
  266.     }  
  267.     else  
  268.     {  
  269.       Exception = "Wrong value of control parameter Slant";  
  270.       throw HException(Exception);  
  271.     }  
  272.     try  
  273.     {  
  274.       set_font(WindowHandle, ((((((("-"+Font)+"-")+Size)+"-*-")+Slant)+"-*-*-")+Bold)+"-");  
  275.     }  
  276.     // catch (Exception)   
  277.     catch (HException &HDevExpDefaultException)  
  278.     {  
  279.       HDevExpDefaultException.ToHTuple(&Exception);  
  280.       throw HException(Exception);  
  281.     }  
  282.   }  
  283.   else  
  284.   {  
  285.     //set font for UNIX systems  
  286.     Size = Size*1.25;  
  287.     AllowedFontSizes.Reset();  
  288.     AllowedFontSizes[0] = 11;  
  289.     AllowedFontSizes[1] = 14;  
  290.     AllowedFontSizes[2] = 17;  
  291.     AllowedFontSizes[3] = 20;  
  292.     AllowedFontSizes[4] = 25;  
  293.     AllowedFontSizes[5] = 34;  
  294.     if (0 != ((AllowedFontSizes.Find(Size))==-1))  
  295.     {  
  296.       Distances = (AllowedFontSizes-Size).Abs();  
  297.       tuple_sort_index(Distances, &Indices);  
  298.       Size = AllowedFontSizes[HTuple(Indices[0])];  
  299.     }  
  300.     if (0 != (HTuple(Font==HTuple("mono")).Or(Font==HTuple("Courier"))))  
  301.     {  
  302.       Font = "courier";  
  303.     }  
  304.     else if (0 != (Font==HTuple("sans")))  
  305.     {  
  306.       Font = "helvetica";  
  307.     }  
  308.     else if (0 != (Font==HTuple("serif")))  
  309.     {  
  310.       Font = "times";  
  311.     }  
  312.     if (0 != (Bold==HTuple("true")))  
  313.     {  
  314.       Bold = "bold";  
  315.     }  
  316.     else if (0 != (Bold==HTuple("false")))  
  317.     {  
  318.       Bold = "medium";  
  319.     }  
  320.     else  
  321.     {  
  322.       Exception = "Wrong value of control parameter Bold";  
  323.       throw HException(Exception);  
  324.     }  
  325.     if (0 != (Slant==HTuple("true")))  
  326.     {  
  327.       if (0 != (Font==HTuple("times")))  
  328.       {  
  329.         Slant = "i";  
  330.       }  
  331.       else  
  332.       {  
  333.         Slant = "o";  
  334.       }  
  335.     }  
  336.     else if (0 != (Slant==HTuple("false")))  
  337.     {  
  338.       Slant = "r";  
  339.     }  
  340.     else  
  341.     {  
  342.       Exception = "Wrong value of control parameter Slant";  
  343.       throw HException(Exception);  
  344.     }  
  345.     try  
  346.     {  
  347.       set_font(WindowHandle, ((((((("-adobe-"+Font)+"-")+Bold)+"-")+Slant)+"-normal-*-")+Size)+"-*-*-*-*-*-*-*");  
  348.     }  
  349.     // catch (Exception)   
  350.     catch (HException &HDevExpDefaultException)  
  351.     {  
  352.       HDevExpDefaultException.ToHTuple(&Exception);  
  353.       throw HException(Exception);  
  354.     }  
  355.   }  
  356.   return;  
  357. }  
  358.   
  359. #ifndef NO_EXPORT_MAIN  
  360. // Main procedure   
  361. void action()  
  362. {  
  363.   using namespace Halcon;  
  364.   
  365.   // Local iconic variables   
  366.   Hobject  Clip, Dark, Single, Selected;  
  367.   
  368.   
  369.   // Local control variables   
  370.   HTuple  Width, Height, WindowID, Phi, Area, Row;  
  371.   HTuple  Column, Length, i;  
  372.   
  373.   //clip.hdev: Orientation of clips  
  374.   //  
  375.   // dev_update_window(...); only in hdevelop  
  376.   read_image(&Clip, "clip");  
  377.   get_image_size(Clip, &Width, &Height);  
  378.   if (HDevWindowStack::IsOpen())  
  379.     close_window(HDevWindowStack::Pop());  
  380.   set_window_attr("background_color","black");  
  381.   open_window(0,0,Width/2,Height/2,0,"","",&WindowID);  
  382.   HDevWindowStack::Push(WindowID);  
  383.   if (HDevWindowStack::IsOpen())  
  384.     disp_obj(Clip, HDevWindowStack::GetActive());  
  385.   set_display_font(WindowID, 14, "mono", "true", "false");  
  386.   disp_continue_message(WindowID, "black", "true");  
  387.   // stop(); only in hdevelop  
  388.   bin_threshold(Clip, &Dark);  
  389.   connection(Dark, &Single);  
  390.   select_shape(Single, &Selected, "area", "and", 5000, 10000);  
  391.   if (HDevWindowStack::IsOpen())  
  392.     set_draw(HDevWindowStack::GetActive(),"fill");  
  393.   if (HDevWindowStack::IsOpen())  
  394.     set_colored(HDevWindowStack::GetActive(),12);  
  395.   if (HDevWindowStack::IsOpen())  
  396.     disp_obj(Selected, HDevWindowStack::GetActive());  
  397.   disp_continue_message(WindowID, "black", "true");  
  398.   // stop(); only in hdevelop  
  399.   if (HDevWindowStack::IsOpen())  
  400.     disp_obj(Clip, HDevWindowStack::GetActive());  
  401.   if (HDevWindowStack::IsOpen())  
  402.     set_color(HDevWindowStack::GetActive(),"green");  
  403.   if (HDevWindowStack::IsOpen())  
  404.     disp_obj(Selected, HDevWindowStack::GetActive());  
  405.   orientation_region(Selected, &Phi);  
  406.   area_center(Selected, &Area, &Row, &Column);  
  407.   if (HDevWindowStack::IsOpen())  
  408.     set_line_width(HDevWindowStack::GetActive(),3);  
  409.   if (HDevWindowStack::IsOpen())  
  410.     set_draw(HDevWindowStack::GetActive(),"margin");  
  411.   Length = 80;  
  412.   for (i=0; i<=(Phi.Num())-1; i+=1)  
  413.   {  
  414.     if (HDevWindowStack::IsOpen())  
  415.       set_color(HDevWindowStack::GetActive(),"blue");  
  416.     disp_arrow(WindowID, HTuple(Row[i]), HTuple(Column[i]), HTuple(Row[i])-(Length*(HTuple(Phi[i]).Sin())),   
  417.         HTuple(Column[i])+(Length*(HTuple(Phi[i]).Cos())), 4);  
  418.     disp_message(WindowID, ((HTuple(Phi[i]).Deg()).ToString("3.1f"))+" deg", "image",   
  419.         HTuple(Row[i]), HTuple(Column[i])-100, "black", "false");  
  420.   }  
  421.   // dev_update_window(...); only in hdevelop  
  422. }  
  423.   
  424.   
  425. #ifndef NO_EXPORT_APP_MAIN  
  426. int main(int argc, char *argv[])  
  427. {  
  428.   using namespace Halcon;  
  429.   // Default settings used in HDevelop (can be omitted)   
  430.   set_system("do_low_error","false");  
  431.   action();  
  432.   return 0;  
  433. }  
  434. #endif  
  435.   
  436.   
  437. #endif  

 
第二步:打开VC6.0建立项目

然后配置链接如下:




更多推荐

halcon程序安装破解与VC6.0结合

本文发布于:2023-06-28 16:45:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/930519.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:程序   halcon

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!