Ask Your Question
0

cv::Mat_ compiling error

asked 2019-12-17 21:57:24 -0600

NTT gravatar image

I have very simple program to use cv::Mat_, and I found a compiling error, it took a lot of time to figure out that I had problem with specific type of integer. I think it might be a bug in OpenCV. Can any one help me to understand the error? Thank you very much in advance!!!!!

I am using Visual Studio Community 2019. The codes as follows:

#include <opencv2/core.hpp>

#ifdef _DEBUG
    
#pragma comment(lib, "opencv_core411d.lib")
    
#else
    
#pragma comment(lib, "opencv_core411.lib")
    
#endif

int main()
{
    cv::Mat_<cv::Vec<int, 3>> mat1;//This is OK
    cv::Mat_<cv::Vec<uint, 3>> mat2;//This causes compiling error. This is also for unsigned int
    cv::Mat_<cv::Vec3i> mat3;    //This is OK
}
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-12-18 01:22:40 -0600

mvuori gravatar image

That's probably because unsigned int is not one of OpenCV's primitive data types.

(Reason for 'probably': you don't tell _what_ the error is.)

edit flag offensive delete link more

Comments

That makes sense! Thank you very much! The problem is for cv::Mat, but it is fine for cv::Vec, eg.:

cv::Vec<unsigned int,="" 3=""> v;     //This is OK

NTT gravatar imageNTT ( 2019-12-18 16:21:34 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-12-17 21:45:17 -0600

Seen: 126 times

Last updated: Dec 18 '19