问题描述
- 请问我写的这个类有什么问题?(Opencv)
-
问下在opencv 中以下代码为何编译时会出现unresolved external symbol 问题?VideoProcessing.h
//视频处理类
#pragma once
#include
#include
#include
#includeusing namespace std;
using namespace cv;class VideoProcessing
{
public:
VideoProcessing();
~VideoProcessing();//成员函数
public:
bool openVideo(string videoName);
int getRate();
double getGapTime();//成员变量
public:
VideoCapture capture;//视频流
Mat frame;//当前视频帧
};VideoProcessing.cpp
#include "VideoProcessing.h"VideoProcessing::VideoProcessing()
{
}VideoProcessing::~VideoProcessing()
{
}//打开视频
bool VideoProcessing::openVideo(string videoName)
{
capture.open(videoName);
if (!capture.isOpened())
{
return false;
}
else
{
return true;
}
}//获取帧率
int VideoProcessing::getRate()
{
return capture.get(CV_CAP_PROP_FPS);
}//获取两帧间隔时间
double VideoProcessing::getGapTime()
{
return 1000 / (double)getRate();
}