OpenCV CV::Mat and Eigen::Matrix

后端 未结 5 1475
孤街浪徒
孤街浪徒 2020-11-29 00:55

Is there a reversible way to convert an OpenCV cv::Mat object to an Eigen::Matrix?

e.g., Some way of doing:

cv::Mat cvMat;
         


        
5条回答
  •  情歌与酒
    2020-11-29 01:34

    This works for me,

      #include 
    
      cv::Mat image;
      image = cv::imread("/dataset/images/15207_angle_image.jpg", CV_LOA D_IMAGE_GRAYSCALE);   // Read the file
      Eigen::Matrix eigen_mat;
      cv::cv2eigen(image, eigen_mat);
    

提交回复
热议问题