How to convert Simd::View to cv::Mat?

485 Views Asked by At

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.

1

There are 1 best solutions below

1
Akira On BEST ANSWER

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;
}