-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCsrLocatePos.h
59 lines (59 loc) · 1.56 KB
/
CsrLocatePos.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// CsrLocatePos.h : header file
//
#ifndef CSR_GET_POS_H
#define CSR_GET_POS_H
#include"bmpFile.h"
#include<opencv2/opencv.hpp>
using namespace cv;
class CsrLocatePos
{
public:
//构造/析构
CsrLocatePos();
~CsrLocatePos();
//初始化
bool Initialize(bool isRGB,int width,int height,int nFast0123);
//执行
bool DoNext(BYTE *pImgData);
//结果
BYTE *GetResImg();
int GetResWidth();
int GetResHeight();
void CsrSobel(BYTE*pGryImg, int width, int height, BYTE *pResImg);
void CsrGetSumImg(BYTE *pGryImg, int width, int height, int *pResImg);
void CsrReduceImgSize(BYTE*pGryImg, int width, int height, int nFast_0123, BYTE *pResImg);
//上左右
void CsrSearchMaxRectA(int* pSumImg, int width, int height, int w, int h, int delLR, int*xL, int*xR, int*yL, int*yR);
//上左
void CsrSearchMaxRectLeftUp(int* pSumImg, int width, int height, int w, int h, int delLR, int*xL, int*xR, int*yL, int*yR);
void CsrDrawRect(BYTE*pGryImg, int width, int height, int& xL, int& xR, int& yL, int& yR, BYTE*pResImg);
bool CsrSearchRectTarget(BYTE*pGryImg, int width, int height, int targetW, int targetH, int delLR, BYTE *pResImg);
private:
// 内存释放
void Dump();
// 调试
void Debug();
void Debug(BYTE*pGryImg, int width, int height, const char * name);
private:
//初始化成功
bool m_isInitOK;
//图像属性
bool m_isRGB;
int m_width;
int m_height;
int nFast;
int m_nShrink;
int shrinkWidth;
int shrinkHeight;
//内存
BYTE *m_pRGBImg;
BYTE *m_pGryImg;
BYTE *m_pGrdImg;
BYTE *m_pTmpImg;
BYTE *m_pResImg;
int * m_pSumImg;
int m_memSize;
//内部计数器
int m_nFrameID;
};
#endif