NeuralEngine
A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes.
FgAfCv.h
1
11#pragma once
12
13#undef min
14#undef max
15
16#include <NeMachineLearningLib.h>
17#include <stdio.h>
18#include <arrayfire.h>
19#include <opencv2/opencv.hpp>
20
21
22namespace NeuralEngine
23{
24 namespace MachineLearning
25 {
35 class NE_IMPEXP AfCv
36 {
37 public:
38 // conversion for gpu
39
49 static void MatToArray(const std::vector<cv::Mat>& input, af::array& output);
50
61 static af::array MatToArray(const cv::Mat& input);
62
63
64 // conversion for cpu
65
76 static void ArrayToMat(const af::array& input_, cv::Mat& output, int type = CV_32F);
77
89 static cv::Mat ArrayToMat(const af::array& input, int type = CV_32F);
90
91 private:
101 static void MatToArray(const cv::Mat& input, af::array& output);
102
103 // get type of a Mat string
104 static std::string get_mat_type(int input);
105 static std::string get_mat_type(const cv::Mat& input);
106 };
107
108#define zero(...) af::constant(0,##__VA_ARGS__);
109 }
110}
111
ArrayFire OpenCV conversation.
Definition: FgAfCv.h:36
static void MatToArray(const cv::Mat &input, af::array &output)
Matrix to array.
static void ArrayToMat(const af::array &input_, cv::Mat &output, int type=CV_32F)
Array to matrix.
static cv::Mat ArrayToMat(const af::array &input, int type=CV_32F)
Array to matrix.
static void MatToArray(const std::vector< cv::Mat > &input, af::array &output)
Matrix to array.
static af::array MatToArray(const cv::Mat &input)
Matrix to array.