-
Notifications
You must be signed in to change notification settings - Fork 0
/
learn.h
57 lines (49 loc) · 1.47 KB
/
learn.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
#include <stdio.h>
#ifndef _LEARN_H_
#define _LEARN_H_
#define false 0
#define true 1
typedef int bool; // or #define bool int
typedef struct
{
//unsigned short bfType;
unsigned long bfSize;
unsigned short bfReserved1;
unsigned short bfReserved2;
unsigned long bfOffBits;
} ClBitMapFileHeader;
typedef struct
{
unsigned long biSize;
long biWidth;
long biHeight;
unsigned short biPlanes;
unsigned short biBitCount;
unsigned long biCompression;
unsigned long biSizeImage;
long biXPelsPerMeter;
long biYPelsPerMeter;
unsigned long biClrUsed;
unsigned long biClrImportant;
} ClBitMapInfoHeader;
typedef struct
{
unsigned char rgbBlue; //该颜色的蓝色分量
unsigned char rgbGreen; //该颜色的绿色分量
unsigned char rgbRed; //该颜色的红色分量
unsigned char rgbReserved; //保留值
} ClRgbQuad;
typedef struct
{
int width;
int height;
int channels;
unsigned char* imageData;
}ClImage;
ClImage* clLoadImage(char* path);
ClImage* clLoadRaw(char* path, int width, int height, int channels);
ClImage* clLoadBlockRaw(FILE* fp, int width, int height, int channels, int h_offset, int v_offset, int number);
double* getHistogramData(ClImage* bmpImg);
double modelMatch(double* srcData, double* desData);
bool clSaveImage(char* path, ClImage* bmpImg);
#endif