• halconremove_obj在区域集中移除某个区域


    在HDevelop中

    read_image (Image, 'D:/bb/tu/4.jpg')
    rgb1_to_gray(Image,Image1)
    threshold (Image1, Region,[80,87,206,195] , [90,100, 228,205])
    
    remove_obj (Region, ObjectsReduced, 4)
    *在区域集中移除某个区域
    *参数1:区域集
    *参数2:输出区域
    *参数3:要移除的区域索引  【区域索引从1开始】
    
    get_image_size (Image1, Width, Height)
    dev_open_window(10,10,Width, Height,'black',WindowHandle)
    dev_display(Region)
    
    dev_open_window(10,100,Width, Height,'black',WindowHandle1)
    dev_display(ObjectsReduced)

    在QtCreator中

      HObject  ho_Image, ho_Image1, ho_Region, ho_ObjectsReduced;
      HTuple  hv_Width, hv_Height, hv_WindowHandle;
      HTuple  hv_WindowHandle1;
    ReadImage(&ho_Image, "D:/bb/tu/4.jpg");
      Rgb1ToGray(ho_Image, &ho_Image1);
      Threshold(ho_Image1, &ho_Region, (((HTuple(80).Append(87)).Append(206)).Append(195)), 
          (((HTuple(90).Append(100)).Append(228)).Append(205)));
    
      RemoveObj(ho_Region, &ho_ObjectsReduced, 4);
      //在区域集中移除某个区域
      //参数1:区域集
      //参数2:输出区域
      //参数3:要移除的区域索引  区域索引从1开始
      GetImageSize(ho_Image1, &hv_Width, &hv_Height); SetWindowAttr("background_color","black"); OpenWindow(10,10,hv_Width,hv_Height,0,"visible","",&hv_WindowHandle); HDevWindowStack::Push(hv_WindowHandle); if (HDevWindowStack::IsOpen()) DispObj(ho_Region, HDevWindowStack::GetActive()); SetWindowAttr("background_color","black"); OpenWindow(10,100,hv_Width,hv_Height,0,"visible","",&hv_WindowHandle1); HDevWindowStack::Push(hv_WindowHandle1); if (HDevWindowStack::IsOpen()) DispObj(ho_ObjectsReduced, HDevWindowStack::GetActive());

  • 相关阅读:
    vs2010使用刚刚配置好的STLport提示检测到"_MSC_VER”的不
    UltraISO制作Linux启动盘
    RedHat 简易配置 VNC Server 与VNC View详细说明!
    数据库中树状关系(各种树状分类)的查找
    java–jsp & javabean
    linux 下android的一键root
    MySQL简明教程及表设计原则
    Activity 生存周期
    java web EL表达式
    ubuntu下调试android手机,并进入手机shell终端
  • 原文地址:https://www.cnblogs.com/liming19680104/p/15982338.html
Copyright © 2020-2023  润新知