• 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());

  • 相关阅读:
    一些$LCT$的瓜皮题目
    写点东西(关于背包问题)
    字符串算法总结
    常系数齐次线性递推
    原根算法与剩余定理
    问题集
    常用链接
    回形针PaperClip
    6.824拾遗
    杂项
  • 原文地址:https://www.cnblogs.com/liming19680104/p/16006895.html
Copyright © 2020-2023  润新知