/normxcorr/trunk

To get this branch, use:
bzr branch http://suren.me/webbzr/normxcorr/trunk
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef _DICT_HW_H
#define _DICT_HW_H

#define MAX_DEVICES 16

typedef struct STDICTContext *DICTContext;

# ifdef __cplusplus
extern "C" {
# endif

enum DICTErrors {
    DICT_ERROR_CUFFT = 1,
    DICT_ERROR_CUDA_MALLOC = 2,
    DICT_ERROR_MALLOC = 3,
    DICT_ERROR_CUDPP = 4,
    DICT_ERROR_IMAGE = 5,
    DICT_ERROR_GLIB = 6
};

enum DICTFlags {
    DICT_FLAGS_DEFAULT = 0,
    DICT_FLAGS_FIXED_FFT_SIZE = 1,
    DICT_FLAGS_MATLAB_MODE = 2,
    DICT_FLAGS_SINGLE_THREAD = 4
};


/**
 * Detect supported hardware devices
 *
 * @return the number of supported hardware devices, 0 - if all detected devices
 * does not meet minimal requirements, and -1 if no devices are detected.
 */
int dictDetectHardware();

DICTContext dictCreateContext();
void dictDestroyContext(DICTContext ctx);

/**
 * Initializes context with given configuration
 *
 * @param ncp is a number of control points
 * @param corrsize is a radius of correlation area (15)
 * @param precision defines number of signifcant digits after decimal point (1000)
 * @return 0 or error code
 */
int dictSetup(DICTContext ctx, int ncp, int corrsize, int precision, int flags);
int dictSetDimensions(DICTContext ps, int width, int height);

int dictSetTemplatePoints(DICTContext ctx, const float *points_x, const float *points_y);
int dictSetCurrentPoints(DICTContext ctx, const float *points_x, const float *points_y);
int dictGetCurrentPoints(DICTContext ctx, float *points_x, float *points_y);

int dictLoadTemplateImage(DICTContext ctx, const unsigned char *img, int width, int height);
int dictLoadTemplateImageFile(DICTContext ctx, const char *name);

int dictLoadImage(DICTContext ctx, const unsigned char *img);
int dictLoadImageFile(DICTContext ctx, const char *name);

int dictSetPointsBuffer(DICTContext ps, float *point_x, float *point_y);
int dictCompute(DICTContext ctx);
int dictProcessImage(DICTContext ctx, const unsigned char *img);
int dictProcessImageFile(DICTContext ctx, const char *name);


    // Internal use only, this functions could be revised
int dictGetCorrelations(DICTContext ps, int icp, float *res);
int dictGetCorrections(DICTContext ps, float *res_x, float *res_y);
int dictGetLocalSum(DICTContext ps, int icp, float *lsum, float *denom);

typedef void (*DICTLogger)(const char *msg, ...);
int dictSetLogger(DICTLogger error_reporter, DICTLogger message_writer);

# ifdef __cplusplus
}
# endif

#endif /* _DICT_HW_H */