-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_Images.h
63 lines (44 loc) · 1.26 KB
/
data_Images.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
60
61
62
63
#ifndef VERSION_CONVOLUTIONNAL_DATA_IMAGES_H
#define VERSION_CONVOLUTIONNAL_DATA_IMAGES_H
typedef struct MinstImg
{
int c, r; //large and width of the image
float** ImgData; //matrix containing data of the image
} MinstImg;
typedef struct Img_1D
{
int r;
float* ImgData; //matrix containing data of the image
float* LabelData;
} Img_1D;
//contains all images
typedef struct MinstImgArr
{
int ImgNum; //number of images
MinstImg* ImgPtr; //pointer to the data of the image
} *MinstImgArr;
typedef struct ImgArr
{
int ImgNum; //number of images
Img_1D* ImgPtr; //pointer to the data of the image
} *ImgArr;
//output?
typedef struct MinstLabel
{
int l; //length of the label
float* LabelData; //output marked data
} MinstLabel;
typedef struct MinstLabelArr
{
int LabelNum;
MinstLabel* LabelPtr;
} *LabelArr;
LabelArr read_Lable(const char* filename); // read label
ImgArr read_Img(const char* filename); // readimg
ImgArr read_Img_1D(const char* filename, int switcher); // readimg
void avereduce2(ImgArr trainImg);
void avereduce4(ImgArr trainImg);
void maxreduce4(ImgArr trainImg);
void conv4kern(ImgArr trainImg);
void maxpooling2s2(ImgArr trainImg);
#endif //VERSION_CONVOLUTIONNAL_DATA_IMAGES_H