libdart_openmvg/src/image.h

98 lines
2.8 KiB
C++

#ifdef __cplusplus
#include <openMVG/image/image_io.hpp>
#include <openMVG/image/image_concat.hpp>
#include <openMVG/vector_graphics/svgDrawer.hpp>
#include <openMVG/features/feature.hpp>
#include <forward_list>
#include <openMVG/sfm/sfm.hpp>
#include <openMVG/features/mser/mser.hpp>
#include <openMVG/cameras/Camera_Common.hpp>
#include <openMVG/cameras/Cameras_Common_command_line_helper.hpp>
#include <openMVG/sfm/pipelines/sfm_features_provider.hpp>
#include <openMVG/sfm/pipelines/sfm_matches_provider.hpp>
#include <openMVG/sfm/sfm_data.hpp>
#include <openMVG/sfm/sfm_data_io.hpp>
#include <openMVG/sfm/sfm_report.hpp>
#include <openMVG/sfm/sfm_view.hpp>
#include <openMVG/system/timer.hpp>
#include <openMVG/types.hpp>
// SfM Engines
#include <openMVG/sfm/pipelines/global/GlobalSfM_rotation_averaging.hpp>
#include <openMVG/sfm/pipelines/global/GlobalSfM_translation_averaging.hpp>
#include <openMVG/sfm/pipelines/global/sfm_global_engine_relative_motions.hpp>
#include <openMVG/sfm/pipelines/sequential/sequential_SfM.hpp>
#include <openMVG/sfm/pipelines/sequential/sequential_SfM2.hpp>
#include <openMVG/sfm/pipelines/sequential/SfmSceneInitializerMaxPair.hpp>
#include <openMVG/sfm/pipelines/sequential/SfmSceneInitializerStellar.hpp>
#include <openMVG/sfm/pipelines/stellar/sfm_stellar_engine.hpp>
#endif // __cplusplus
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <png.h>
#ifdef __cplusplus
# define _FFI_PLUGIN extern "C" __attribute__((visibility("default"))) __attribute__((used))
#else
# define _FFI_PLUGIN __attribute__((visibility("default"))) __attribute__((used))
#endif // __cplusplus
#if defined(__cplusplus)
extern "C" {
auto png_sig_cm = png_sig_cmp;
}
#endif // __cplusplus
typedef struct _Frame
{
FILE *stream;
int w;
int h;
int depth;
} Frame;
typedef struct _ImageResult
{
u_char *data;
size_t data_len;
error_t error;
} ImageResult;
_FFI_PLUGIN
ImageResult *image_result_new(const u_char *, const size_t data_len);
_FFI_PLUGIN
ImageResult *image_result_new_error(const error_t);
_FFI_PLUGIN
int image_result_free(ImageResult *);
_FFI_PLUGIN
const Frame *new_frame_from_handle(FILE *, int, int, int);
_FFI_PLUGIN
const Frame *
new_frame_from_data(const uint8_t *, const size_t, int, int, int);
#ifdef __cplusplus
typedef openMVG::image::Image<openMVG::image::RGBColor> RgbImage;
typedef std::vector<openMVG::features::AffinePointFeature> FeatureVector;
typedef openMVG::image::Image<unsigned char> UImage;
typedef std::vector<openMVG::features::MSER::MSERRegion> RegionVector;
typedef openMVG::sfm::SfM_Data Sfm_Data;
extern "C" namespace Archimedes
{
ImageResult *get_image_data(const Frame *);
int images_to_sfm(const Frame **, size_t);
}
#endif
_FFI_PLUGIN
ImageResult *archimedes_get_image_data(const Frame *);
_FFI_PLUGIN
int archimedes_images_to_sfm(const Frame **, size_t);