#ifndef MLPP_CONVOLUTIONS_H #define MLPP_CONVOLUTIONS_H #include "core/containers/vector.h" #include "core/string/ustring.h" #include "core/math/math_defs.h" #include "../lin_alg/mlpp_matrix.h" #include "../lin_alg/mlpp_tensor3.h" #include "../lin_alg/mlpp_vector.h" #include "core/object/reference.h" class MLPPConvolutions : public Reference { GDCLASS(MLPPConvolutions, Reference); public: enum PoolType { POOL_TYPE_AVERAGE = 0, POOL_TYPE_MIN, POOL_TYPE_MAX, }; Ref convolve_2d(const Ref &input, const Ref &filter, const int S, const int P = 0); Ref convolve_3d(const Ref &input, const Ref &filter, const int S, const int P = 0); Ref pool_2d(const Ref &input, const int F, const int S, const PoolType type); Ref pool_3d(const Ref &input, const int F, const int S, const PoolType type); real_t global_pool_2d(const Ref &input, const PoolType type); Ref global_pool_3d(const Ref &input, const PoolType type); real_t gaussian_2d(const real_t x, const real_t y, const real_t std); Ref gaussian_filter_2d(const int size, const real_t std); Ref dx(const Ref &input); Ref dy(const Ref &input); Ref grad_magnitude(const Ref &input); Ref grad_orientation(const Ref &input); Ref compute_m(const Ref &input); Vector> compute_mv(const Ref &input); //TODO better data srtucture for this. Maybe IntMatrix? Vector> harris_corner_detection(const Ref &input); Ref get_prewitt_horizontal() const; Ref get_prewitt_vertical() const; Ref get_sobel_horizontal() const; Ref get_sobel_vertical() const; Ref get_scharr_horizontal() const; Ref get_scharr_vertical() const; Ref get_roberts_horizontal() const; Ref get_roberts_vertical() const; MLPPConvolutions(); protected: static void _bind_methods(); Ref _prewitt_horizontal; Ref _prewitt_vertical; Ref _sobel_horizontal; Ref _sobel_vertical; Ref _scharr_horizontal; Ref _scharr_vertical; Ref _roberts_horizontal; Ref _roberts_vertical; }; #endif // Convolutions_hpp