Emgu CV 3 findContours and hierarchy parameter of type Vec4i equivalent?

后端 未结 3 1918
我寻月下人不归
我寻月下人不归 2020-12-15 13:54

I\'m attempting to translate the following OpenCV C++ code into Emgu CV 3:

std::vector > contours;
std::vector

        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-15 14:31

    You can simply create a

    Matrix

    then copy you Mat object data into that Matrix. See Example below:

      Mat hierarchy = new Mat();
      CvInvoke.FindContours(imgThreshCopy, contours, hierarchy , RetrType.Tree,ChainApproxMethod.ChainApproxSimple);
    
      Matrix matrix = new Matrix(hierarchy.Rows, hierarchy.Cols,hierarchy.NumberOfChannels);
      hierarchy.CopyTo(matrix);
    

    Data can be accessed in

    matrix.Data

    Good Luck. H

提交回复
热议问题