summaryrefslogtreecommitdiffhomepage
path: root/cv/numeric.hpp
blob: 87fe7a698a6cd24c77d552fa8af02d1fabb0623f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

#include <type_traits>
#include <opencv2/core.hpp>

namespace numeric_types {
    using f = float;

    static_assert(std::is_floating_point_v<f>);

    static constexpr inline f eps = f(1e-8);
    static constexpr inline f pi = f(M_PI);

    template<int n> using vec = cv::Vec<f, n>;
    using vec2 = vec<2>;
    using vec3 = vec<3>;

    template<int y, int x> using mat = cv::Matx<f, y, x>;
    using mat33 = mat<3, 3>;
    using mat22 = mat<2, 2>;
}