[英]Incomplete type “cv::Mat” opencv c++
我想在opencv中為我的光線追蹤項目創建一個矩陣。 這是我提出的代碼:
#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;
}
而我對兩個Mat有問題。 它說variable has incomplete type "cv::Mat"
。 我無法理解這意味着什么。 我總是只寫Mat沒有別的。
有人能幫助我嗎?
只需包含“opencv2 / core / core.hpp” 。
您可以使用下面的示例代碼。
#include "opencv2/core/core.hpp"
using namespace cv;
Mat createImage()
{
Mat b(480, 640, CV_8UC3);
return b;
}
int main()
{
createImage();
}
你只需要'#include'core / core.hpp“`
編譯器需要能夠找到包含文件,在編譯器的include目錄列表中是否有Opencv/Include
? 找到core.hpp有什么錯誤嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.