sagoma/geometry.h

31 lines
959 B
C
Raw Normal View History

2017-01-12 15:15:34 +01:00
#ifdef HAS_OPENCV3
#include <opencv2/core.hpp> //Any OPENCV3 code
#else
#include <opencv2/core/core.hpp> //Any Opencv2 code
#endif
double dist(cv::Point, cv::Point);
double inner_angle(cv::Point, cv::Point, cv::Point);
cv::Point map_point(double, cv::Point, cv::Point);
cv::Point unmap_point(double, cv::Point, cv::Point);
cv::Vec<double,3> get_line(cv::Point, cv::Point);
bool is_in_line(cv::Vec<double,3> line, cv::Point p);
bool is_above_line(cv::Vec<double,3> line, cv::Point p);
2017-01-26 00:02:56 +01:00
double line_value(cv::Vec<double,3>, cv::Point);
2017-01-13 00:16:22 +01:00
cv::Point further_point_from_line(cv::Vec<double,3>, std::vector<cv::Point>);
class CoordinateSystem
{
private:
double theta;
cv::Matx<double,2,2> R, Rt;
cv::Point origin;
void precompute();
public:
CoordinateSystem(cv::Point, cv::Point);
CoordinateSystem(double angle, cv::Point origin_);
cv::Point map(cv::Point p);
cv::Point unmap(cv::Point p);
};