diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-10-08 17:53:59 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-01-28 13:37:19 +0400 |
commit | 9178dc9d384f18ab2f23656fb6b01a3b444526ef (patch) | |
tree | 7ca0ded6874ce96c9ac7747dca790b0a12ae5e90 /extern/libmv/libmv-capi.h | |
parent | f194ab765996cb9830da2396f28f1ddad1778d0b (diff) |
Rework detector API and implement Harris detector
Switch the detector API to a single function which accepts
a float image and detector options. This makes usage of
feature detection more unified across different algorithms.
Options structure is pretty much straightforward and contains
detector to be used and all the detector-specific settings.
Also implemented Harris feature detection algorithm which
is not as fast as FAST one but is expected to detect more
robust feature points. It is also likely that less features
are detected, but better quality than quantity.
Blender will now use Harris detector by default, later we'll
remove FAST detector.
Diffstat (limited to 'extern/libmv/libmv-capi.h')
-rw-r--r-- | extern/libmv/libmv-capi.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/extern/libmv/libmv-capi.h b/extern/libmv/libmv-capi.h index 13cc3ae8499..d183bc4cd41 100644 --- a/extern/libmv/libmv-capi.h +++ b/extern/libmv/libmv-capi.h @@ -118,10 +118,29 @@ double libmv_reprojectionError(const struct libmv_Reconstruction *libmv_reconstr struct libmv_CameraIntrinsics *libmv_reconstructionExtractIntrinsics(struct libmv_Reconstruction *libmv_Reconstruction); /* Feature detector */ -struct libmv_Features *libmv_detectFeaturesFAST(const unsigned char *data, int width, int height, int stride, - int margin, int min_trackness, int min_distance); -struct libmv_Features *libmv_detectFeaturesMORAVEC(const unsigned char *data, int width, int height, int stride, - int margin, int count, int min_distance); +enum { + LIBMV_DETECTOR_FAST, + LIBMV_DETECTOR_MORAVEC, + LIBMV_DETECTOR_HARRIS, +}; + +typedef struct libmv_DetectOptions { + int detector; + int margin; + int min_distance; + int fast_min_trackness; + int moravec_max_count; + unsigned char *moravec_pattern; + double harris_threshold; +} libmv_DetectOptions; + +struct libmv_Features *libmv_detectFeaturesByte(const unsigned char *image_buffer, + int width, int height, int channels, + libmv_DetectOptions *options); +struct libmv_Features *libmv_detectFeaturesFloat(const float *image_buffer, + int width, int height, int channels, + libmv_DetectOptions *options); + void libmv_featuresDestroy(struct libmv_Features *libmv_features); int libmv_countFeatures(const struct libmv_Features *libmv_features); void libmv_getFeature(const struct libmv_Features *libmv_features, int number, double *x, double *y, double *score, |