• halconcontour_point_num_xld返回XLD轮廓中点的数目


    在HDevelop中

    dev_close_window ()
    read_image (Image, 'D:/bb/tu/6.jpg')
    rgb1_to_gray (Image, GrayImage)
    
    edges_sub_pix (GrayImage, Edges, 'canny', 1, 5, 10)
    select_shape_xld (Edges, SelectedXLD, 'area', 'and', 5500, 5600)
    
    contour_point_num_xld (SelectedXLD, Length)
    *返回一个XLD轮廓(contour)中点的数目
    
    get_image_size (GrayImage, Width, Height)
    
    dev_open_window(10,10,Width, Height,'black',WindowHandle1)
    dev_display(SelectedXLD)

     

    在QtCreator中

      HObject  ho_Image, ho_GrayImage, ho_Edges, ho_SelectedXLD;
      HTuple  hv_Length, hv_Width, hv_Height, hv_WindowHandle1;
      ReadImage(&ho_Image, "D:/bb/tu/6.jpg");
      Rgb1ToGray(ho_Image, &ho_GrayImage);
    
      EdgesSubPix(ho_GrayImage, &ho_Edges, "canny", 1, 5, 10);
      SelectShapeXld(ho_Edges, &ho_SelectedXLD, "area", "and", 5500, 5600);
    
      ContourPointNumXld(ho_SelectedXLD, &hv_Length);
      //返回一个XLD轮廓(contour)中点的数目
    
      GetImageSize(ho_GrayImage, &hv_Width, &hv_Height);
    
      SetWindowAttr("background_color","black");
      OpenWindow(10,10,hv_Width,hv_Height,0,"visible","",&hv_WindowHandle1);
      HDevWindowStack::Push(hv_WindowHandle1);
      if (HDevWindowStack::IsOpen())
        DispObj(ho_SelectedXLD, HDevWindowStack::GetActive());

  • 相关阅读:
    Typora上传图片设置
    SpringBoot入门详细教程
    vue
    我才学习到的严格模式(越往后看,越感觉复杂啊)
    js中三种定义变量的方式const, var, let的区别。
    冒泡
    tab切换
    日历
    jquery实现拖拽进度条并显示百分比的特效
    抽奖代码
  • 原文地址:https://www.cnblogs.com/liming19680104/p/16006895.html
Copyright © 2020-2023  润新知