-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvc.h
42 lines (31 loc) · 1.31 KB
/
vc.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
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// INSTITUTO POLITÉCNICO DO CÁVADO E DO AVE
// 2011/2012
// ENGENHARIA DE SISTEMAS INFORMÁTICOS
// VISÃO POR COMPUTADOR
//
// [ DUARTE DUQUE - [email protected] ]
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#define VC_DEBUG
#define MAX(a,b)(a>b?a:b)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ESTRUTURA DE UMA IMAGEM
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
typedef struct {
unsigned char *data;
int width, height;
int channels; // Binário/Cinzentos=1; RGB=3
int levels; // Binário=1; Cinzentos [1,255]; RGB [1,255]
int bytesperline; // width * channels
} IVC;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// PROTÓTIPOS DE FUNÇÕES
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// FUNÇÕES: ALOCAR E LIBERTAR UMA IMAGEM
IVC *vc_image_new(int width, int height, int channels, int levels);
IVC *vc_image_free(IVC *image);
// FUNÇÕES: LEITURA E ESCRITA DE IMAGENS (PBM, PGM E PPM)
IVC *vc_read_image(char *filename);
int vc_write_image(char *filename, IVC *image);
// EDGE DETECTION
int vc_gray_edge_prewitt(IVC *src, IVC *dst, float th);