Skip to content

Commit

Permalink
Merge pull request #2 from vpisarev/julia-phase1
Browse files Browse the repository at this point in the history
a few fixes to compile julia bindings on mac
  • Loading branch information
archit120 committed May 22, 2020
2 parents f8862b5 + 9e6e55b commit cd5afec
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 24 deletions.
17 changes: 11 additions & 6 deletions modules/julia/CMakeLists.txt
Expand Up @@ -18,13 +18,18 @@ elseif (${ARCH} EQUAL 64 AND NOT ${Julia_WORD_SIZE} MATCHES "64")
return()
endif()

if(NOT JlCxx_DIR)
execute_process(
COMMAND "${Julia_EXECUTABLE}" --startup-file=no -e "using CxxWrap; print(CxxWrap.CxxWrapCore.prefix_path())"
OUTPUT_VARIABLE JlCxx_DIR
OUTPUT_VARIABLE JlCxx_DIR_prefix
)

if(JlCxx_DIR_prefix)
set(JlCxx_DIR "${JlCxx_DIR_prefix}/lib/cmake/JlCxx")
endif()
endif()

find_package(JlCxx REQUIRED)
find_package(JlCxx QUIET)

if(NOT JlCxx_FOUND)
ocv_module_disable(julia)
Expand All @@ -34,7 +39,7 @@ else()
endif()

set(the_description "The Julia bindings")
ocv_add_module(julia BINDINGS
ocv_add_module(julia
opencv_core
opencv_imgproc
opencv_imgcodecs
Expand Down Expand Up @@ -91,9 +96,9 @@ message(STATUS \"Install output: \${JULIA_INSTALL_OUT}\")

# ocv_create_module()

ocv_add_accuracy_tests()
ocv_add_perf_tests()
ocv_add_samples()
#ocv_add_accuracy_tests()
#ocv_add_perf_tests()
#ocv_add_samples()

message(STATUS ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK})

Expand Down
40 changes: 22 additions & 18 deletions modules/julia/src/jlcv2.hpp
Expand Up @@ -9,42 +9,46 @@
#include "jlcxx/array.hpp"
#include "jlcxx/tuple.hpp"

#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/opencv_modules.hpp>
#include <type_traits>


using namespace cv;
using namespace std;
using namespace jlcxx;

#ifdef HAVE_OPENCV_FEATURES2D
typedef SimpleBlobDetector::Params SimpleBlobDetector_Params;
typedef AKAZE::DescriptorType AKAZE_DescriptorType;
typedef AgastFeatureDetector::DetectorType AgastFeatureDetector_DetectorType;
typedef FastFeatureDetector::DetectorType FastFeatureDetector_DetectorType;
typedef DescriptorMatcher::MatcherType DescriptorMatcher_MatcherType;
typedef KAZE::DiffusivityType KAZE_DiffusivityType;
typedef ORB::ScoreType ORB_ScoreType;
#include <opencv2/features2d.hpp>
typedef cv::SimpleBlobDetector::Params SimpleBlobDetector_Params;
typedef cv::AKAZE::DescriptorType AKAZE_DescriptorType;
typedef cv::AgastFeatureDetector::DetectorType AgastFeatureDetector_DetectorType;
typedef cv::FastFeatureDetector::DetectorType FastFeatureDetector_DetectorType;
typedef cv::DescriptorMatcher::MatcherType DescriptorMatcher_MatcherType;
typedef cv::KAZE::DiffusivityType KAZE_DiffusivityType;
typedef cv::ORB::ScoreType ORB_ScoreType;
#endif

#ifdef HAVE_OPENCV_OBJDETECT

#include "opencv2/objdetect.hpp"

typedef HOGDescriptor::HistogramNormType HOGDescriptor_HistogramNormType;
typedef HOGDescriptor::DescriptorStorageFormat HOGDescriptor_DescriptorStorageFormat;
typedef cv::HOGDescriptor::HistogramNormType HOGDescriptor_HistogramNormType;
typedef cv::HOGDescriptor::DescriptorStorageFormat HOGDescriptor_DescriptorStorageFormat;

#endif

#ifdef HAVE_OPENCV_FLANN
#include <opencv2/flann.hpp>
typedef cvflann::flann_distance_t cvflann_flann_distance_t;
typedef cvflann::flann_algorithm_t cvflann_flann_algorithm_t;

typedef flann::IndexParams flann_IndexParams;
typedef flann::SearchParams flann_SearchParams;
typedef cv::flann::IndexParams flann_IndexParams;
typedef cv::flann::SearchParams flann_SearchParams;
#endif

using namespace cv;
using namespace std;
using namespace jlcxx;

template <typename C>
struct get_template_type;
template <typename C>
Expand Down Expand Up @@ -77,4 +81,4 @@ struct force_enum_int{
using Type = typename force_enum<T, std::is_enum<T>::value>::Type;
};

#include "jlcv2_types.hpp"
#include "jlcv2_types.hpp"

0 comments on commit cd5afec

Please sign in to comment.