• halconintersection获得区域的交集


    在HDevelop中

    dev_open_window (0, 0, 300, 300, 'black', WindowHandle)
    gen_region_line (RegionLines, 100, 50, 150, 250)
    gen_region_line (RegionLines1, 150, 50, 100, 250)
    
    dev_display(RegionLines)
    dev_display(RegionLines1)
    
    dev_set_color ('yellow')
    intersection (RegionLines, RegionLines1, RegionIntersection)
    *获得区域的交集
    *参数3:输出区域
    
    dev_display(RegionIntersection)


    在Qt Creator中

      HObject  ho_RegionLines, ho_RegionLines1, ho_RegionIntersection;
      HTuple  hv_WindowHandle;
      SetWindowAttr("background_color","black");
      OpenWindow(0,0,300,300,0,"visible","",&hv_WindowHandle);
      HDevWindowStack::Push(hv_WindowHandle);
      GenRegionLine(&ho_RegionLines, 100, 50, 150, 250);
      GenRegionLine(&ho_RegionLines1, 150, 50, 100, 250);
    
      if (HDevWindowStack::IsOpen())
        DispObj(ho_RegionLines, HDevWindowStack::GetActive());
      if (HDevWindowStack::IsOpen())
        DispObj(ho_RegionLines1, HDevWindowStack::GetActive());
    
      if (HDevWindowStack::IsOpen())
        SetColor(HDevWindowStack::GetActive(),"yellow");
      Intersection(ho_RegionLines, ho_RegionLines1, &ho_RegionIntersection);
      //获得区域的交集
      //参数3:输出区域
    
      if (HDevWindowStack::IsOpen())
        DispObj(ho_RegionIntersection, HDevWindowStack::GetActive());

  • 相关阅读:
    我眼中的SCRUM
    文本转换程序
    免费接口
    看板,敏捷的另一种实现方式
    Android Asynchronous Http Client-Android异步网络请求客户端接口
    hdu4753 Fishhead’s Little Game 状态压缩,总和一定的博弈
    dbcp、c3p0、jdbc常用连接配置
    IE安全分析
    redis入侵小结
    heartbleed漏洞利用
  • 原文地址:https://www.cnblogs.com/liming19680104/p/15983438.html
Copyright © 2020-2023  润新知