2

I want to use OpenCV 3.2 and Simd in one c++ project. Is there easy way to convert cv::Mat (image type in OpenCV) to Simd::View (image type used in Simd Library)? Help me please.

John
  • 65
  • 5

1 Answers1

1

It is simple. You just have to define macro SIMD_OPENCV_ENABLE before including of Simd headers:

#include <opencv2/core/core.hpp>
#define SIMD_OPENCV_ENABLE
#include "Simd/SimdLib.hpp"

typedef Simd::View<Simd::Allocator> View;

void test()
{
    cv::Mat cvImage;
    View simdImage;

    cvImage = simdImage;
    simdImage = cvImage;
}
Akira
  • 213
  • 2
  • 11