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;
Eigen::Matrix eigMat;
camera->retrieve(cvMat);
// magic to convert cvMat to eigMat
// work on eigMat
// convert eigMat back to cvMat
imshow("Image", cvMat);
I've tried using cv2eigen
and eigen2cv
, but the resulting cvMat
is completely mangled and I'm not exactly sure why. The dimensions are correct, but the graphics are totally trashed, so possibly a bytes-per-pixel or datasize issue?