Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Incomplete type "cv::Mat" opencv c++

I want to create a matrice in opencv for my project of raytracing. This is the code I have come up:

#include "Windows.h"
#include "core/mat.hpp"
#include "core/core.hpp"
#include "core/types_c.h"

using namespace cv;

Mat createImage()
{
     Mat b(480, 640, CV_8UC3);
     return b;
}

And I have problem with the two Mat. It says variable has incomplete type "cv::Mat". I can't understand what it means. I always wrote only Mat nothing else.

Can someone help me please?

like image 871
Ekica Avatar asked Oct 02 '22 22:10

Ekica


1 Answers

Just include "opencv2/core/core.hpp".
You can use below example code.

#include "opencv2/core/core.hpp"
using namespace cv;   

Mat createImage()
{
 Mat b(480, 640, CV_8UC3);
 return b;
}

int main()
{
   createImage();
}
like image 72
Sagar Patel Avatar answered Oct 05 '22 12:10

Sagar Patel