You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.2 KiB
66 lines
1.2 KiB
/*
|
|
//图片基本处理
|
|
*/
|
|
#ifndef AIClassify_H_
|
|
#define AIClassify_H_
|
|
#include <opencv2/opencv.hpp>
|
|
using namespace std;
|
|
|
|
struct AI_PIECE_INFO
|
|
{
|
|
int num;
|
|
int len;
|
|
int abs_L;
|
|
int long_num;
|
|
int short_num;
|
|
AI_PIECE_INFO()
|
|
{
|
|
num = 0;
|
|
len = 0;
|
|
abs_L = 0;
|
|
long_num = 0;
|
|
short_num = 0;
|
|
}
|
|
void print(std::string str)
|
|
{
|
|
printf("%s>> num %d len %d abs_L %d long_num %d short_num %d\n", str.c_str(), num, len, abs_L, long_num, short_num);
|
|
}
|
|
};
|
|
struct AI_Classify_Info
|
|
{
|
|
int num; // 数量
|
|
float score; // 得分
|
|
float avgScore; // 平均得分
|
|
AI_Classify_Info()
|
|
{
|
|
Init();
|
|
}
|
|
void Init()
|
|
{
|
|
num = 0;
|
|
score = 0;
|
|
avgScore = 0;
|
|
}
|
|
void print(std::string str)
|
|
{
|
|
printf("%s==== num %d score %f avgScore %f\n", str.c_str(), num, score, avgScore);
|
|
}
|
|
};
|
|
|
|
class AIClassify
|
|
{
|
|
|
|
public:
|
|
AIClassify();
|
|
~AIClassify();
|
|
// 分类
|
|
int GetDetRoiList(const cv::Mat &src_Img, cv::Rect qx_roi, std::vector<cv::Rect> &samllRoiList,int nwidth,int nheight);
|
|
|
|
private:
|
|
cv::Rect GetCutRoi(cv::Rect roi, const cv::Mat &img,int nwidth,int nheight);
|
|
// 获取检测roi list
|
|
|
|
private:
|
|
};
|
|
|
|
#endif |