-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdm_helper.h
66 lines (54 loc) · 1.67 KB
/
dm_helper.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
64
65
66
/*
* Copyright (C) 2021 prodeveloper0
*
* DeepMatching Helper Library
*/
#pragma once
#ifndef LIBDEEPMATCHING_HELPER_H
#define LIBDEEPMATCHING_HELPER_H
#endif
#ifdef _MSC_VER
#define DECLEARE_EXPORT __declspec(dllexport)
#define DECLEARE_IMPORT __declspec(dllimport)
#else
#define DECLEARE_EXPORT __attribute__((visibility("default")))
#define DECLEARE_IMPORT __attribute__((visibility("default")))
#endif
#ifdef LIBDEEPMATCHING_HELPER_EXPORTS
#define DM_EXPORT DECLEARE_EXPORT
#else
#define DM_EXPORT DECLEARE_IMPORT
#endif
#include <cstddef>
// Equivalent to corres_t
typedef struct {
float x0, y0;
float x1, y1;
float maxima;
float score;
} dm_corres;
// Equivalent to image_t
typedef struct {
int width;
int height;
int stride;
float* data;
} dm_image;
// Equilvalent to dm_params_t
typedef struct {
void* inner_ptr;
int downscale_factor;
int neighbor_radius;
int max_patch_size;
int verbose;
int nthread;
} dm_params;
extern "C" DM_EXPORT void* dm_alloc(size_t size);
extern "C" DM_EXPORT void dm_free(void* ptr);
extern "C" DM_EXPORT int dm_alloc_params(dm_params* params);
extern "C" DM_EXPORT int dm_update_params(dm_params* params);
extern "C" DM_EXPORT void dm_free_params(dm_params* params);
extern "C" DM_EXPORT int dm_copy_params(const dm_params* sparams, dm_params* dparams);
extern "C" DM_EXPORT int dm_move_params(dm_params* sparams, dm_params* dparams);
extern "C" DM_EXPORT int dm_compute_unsafe(dm_params* params, dm_image* im1, dm_image* im2, dm_corres** corres, int* count);
extern "C" DM_EXPORT int dm_compute(dm_params* params, dm_image* im1, dm_image* im2, dm_corres** corres, int* count);