You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
881 B
C

#pragma once
#include "cv.h"
#include "highgui.h"
#include "qstring.h"
class TempImageInfo {
public:
TempImageInfo(const cv::Mat &img, QString strFileName, QString strFilePath)
{
m_strFileName = strFileName; m_strAbsoluteFilePath = strFilePath; img.copyTo(m_img);
};
QString m_strFileName;
QString m_strAbsoluteFilePath;
cv::Mat m_img;
};
class TempImage
{
public:
TempImage();
~TempImage();
void init(const QString&, const QString &);
void reload(const QString& strbase, const QString &str);
void add(cv::Mat &img, QString strFileName, QString strFilePath);
void remove(const QString& strKey);
std::vector<cv::Mat> getImgVector();
std::vector<cv::Mat> getImgVector(int nPos);
std::vector<TempImageInfo*> getVectors();
int getImgCount(){ return m_imgTemplateLib.size(); }
private:
bool release();
private:
std::vector<TempImageInfo*> m_imgTemplateLib;
};