pmlpp/mlpp/convolutions/convolutions.h

52 lines
2.4 KiB
C
Raw Normal View History

2023-01-24 18:52:45 +01:00
#ifndef MLPP_CONVOLUTIONS_H
#define MLPP_CONVOLUTIONS_H
#include <vector>
#include <string>
2023-01-27 13:01:16 +01:00
#include "core/math/math_defs.h"
2023-01-24 19:37:08 +01:00
class MLPPConvolutions {
2023-01-24 19:00:54 +01:00
public:
2023-01-24 19:37:08 +01:00
MLPPConvolutions();
2023-01-27 13:01:16 +01:00
std::vector<std::vector<real_t>> convolve(std::vector<std::vector<real_t>> input, std::vector<std::vector<real_t>> filter, int S, int P = 0);
std::vector<std::vector<std::vector<real_t>>> convolve(std::vector<std::vector<std::vector<real_t>>> input, std::vector<std::vector<std::vector<real_t>>> filter, int S, int P = 0);
std::vector<std::vector<real_t>> pool(std::vector<std::vector<real_t>> input, int F, int S, std::string type);
std::vector<std::vector<std::vector<real_t>>> pool(std::vector<std::vector<std::vector<real_t>>> input, int F, int S, std::string type);
real_t globalPool(std::vector<std::vector<real_t>> input, std::string type);
std::vector<real_t> globalPool(std::vector<std::vector<std::vector<real_t>>> input, std::string type);
real_t gaussian2D(real_t x, real_t y, real_t std);
std::vector<std::vector<real_t>> gaussianFilter2D(int size, real_t std);
std::vector<std::vector<real_t>> dx(std::vector<std::vector<real_t>> input);
std::vector<std::vector<real_t>> dy(std::vector<std::vector<real_t>> input);
std::vector<std::vector<real_t>> gradMagnitude(std::vector<std::vector<real_t>> input);
std::vector<std::vector<real_t>> gradOrientation(std::vector<std::vector<real_t>> input);
std::vector<std::vector<std::vector<real_t>>> computeM(std::vector<std::vector<real_t>> input);
std::vector<std::vector<std::string>> harrisCornerDetection(std::vector<std::vector<real_t>> input);
std::vector<std::vector<real_t>> getPrewittHorizontal();
std::vector<std::vector<real_t>> getPrewittVertical();
std::vector<std::vector<real_t>> getSobelHorizontal();
std::vector<std::vector<real_t>> getSobelVertical();
std::vector<std::vector<real_t>> getScharrHorizontal();
std::vector<std::vector<real_t>> getScharrVertical();
std::vector<std::vector<real_t>> getRobertsHorizontal();
std::vector<std::vector<real_t>> getRobertsVertical();
2023-01-24 19:00:54 +01:00
private:
2023-01-27 13:01:16 +01:00
std::vector<std::vector<real_t>> prewittHorizontal;
std::vector<std::vector<real_t>> prewittVertical;
std::vector<std::vector<real_t>> sobelHorizontal;
std::vector<std::vector<real_t>> sobelVertical;
std::vector<std::vector<real_t>> scharrHorizontal;
std::vector<std::vector<real_t>> scharrVertical;
std::vector<std::vector<real_t>> robertsHorizontal;
std::vector<std::vector<real_t>> robertsVertical;
2023-01-24 19:00:54 +01:00
};
#endif // Convolutions_hpp