|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #pragma once
-
- #include <opencv2/opencv.hpp>
-
- using namespace cv;
- using namespace std;
-
-
- class LFRPoint
- {
- private:
- /* data */
- public:
- double x, y;
- LFRPoint(/* args */);
- LFRPoint(double x, double y);
- ~LFRPoint();
-
- LFRPoint operator-(const LFRPoint& pt){return LFRPoint(x-pt.x, y-pt.y);}
- LFRPoint operator+(const LFRPoint& pt){return LFRPoint(x+pt.x, y+pt.y);}
- };
-
- class LFRVector : public LFRPoint
- {
- private:
- /* data */
- public:
- LFRVector(/* args */);
- LFRVector(double x, double y);
- LFRVector(const LFRPoint& pt);
- ~LFRVector();
-
- };
-
- class LFRLine
- {
- private:
- /* data */
-
- public:
- LFRPoint start;
- LFRVector dir;
-
- LFRLine(/* args */);
- LFRLine(LFRPoint start, LFRVector dir);
- LFRLine(LFRPoint start, LFRPoint end);
- ~LFRLine();
- };
-
- class VectorOfLines{
- private:
- public:
- Point startPoint;
- float gradient;
- float zeroPoint;
- VectorOfLines();
- ~VectorOfLines();
- static double calcGradient(Point x, Point y);
- float calcZeroPoint(cv::Point x, float m);
- static double calcDistance(Point p0, Point p1);
- vector<Vec4i> findMiddleLine(vector<Vec4i> &lines);
-
- };
|