#ifndef LINE_H
#define LINE_H

#pragma once
#include <stdio.h>
#include <opencv2/opencv.hpp>            
#include <iostream>

namespace cv{

class Line{
    public:
        Line();

        ~Line();

        double get_Y_intercept();

        Line operator + (Line const &obj);

        Line operator /(Line const &obj);

        Line operator /(double const &number);

        Point center();

    public:
        cv::Point begin, end;

};//end_class_Line

Point get_Center(Point first, Point second);

void filter_straight_Lines(std::vector<Line> &lines, int8_t gap_px = 10, const char flag = 'a');

std::vector<Point> get_Intercept_Point(std::vector<Line> lines);
    
std::vector<Point> get_Intercept_Point(Mat& img, std::vector<Line> lines, bool showPoint = false);

Line avg_Line(std::vector<Line> lines);

std::vector<std::vector<Line>> sortLines_Y_intercept(std::vector<Line> lines, double const turning_point = 0);

void get_Bottom_Line_of_Axis(std::vector<Line> &lines, char const flag, unsigned long const number = 2);

void get_Top_Line_of_Axis(std::vector<Line> &lines, char const flag, unsigned long const number = 1);

};//end_namespace_cv
#endif // MAINWIN_H
