2022-11-10 17:07:39 +01:00
|
|
|
#pragma once
|
|
|
|
|
2022-11-03 09:23:30 +01:00
|
|
|
#include <iostream>
|
2022-11-10 14:41:27 +01:00
|
|
|
#include <future>
|
|
|
|
#include <thread>
|
|
|
|
|
2022-11-03 09:23:30 +01:00
|
|
|
#include <opencv2/opencv.hpp>
|
2022-11-10 14:41:27 +01:00
|
|
|
|
2022-11-03 09:23:30 +01:00
|
|
|
#include <input.h>
|
|
|
|
#include <processing.h>
|
|
|
|
#include <control_module.h>
|
|
|
|
#include <interpreter.h>
|
|
|
|
#include <intersection_handler.h>
|
2022-11-10 14:41:27 +01:00
|
|
|
|
2022-11-03 09:23:30 +01:00
|
|
|
|
|
|
|
using namespace cv;
|
|
|
|
|
|
|
|
class LFR
|
|
|
|
{
|
|
|
|
Input input;
|
|
|
|
Processing processing;
|
|
|
|
ControlModule controlModule;
|
|
|
|
Interpreter interpreter;
|
|
|
|
IntersectionHandler intersectionHandler;
|
2022-11-03 11:18:18 +01:00
|
|
|
volatile bool iAmLooping;
|
2022-11-03 09:23:30 +01:00
|
|
|
void loop();
|
2022-11-10 14:41:27 +01:00
|
|
|
thread loopThread;
|
2022-11-10 21:08:35 +01:00
|
|
|
int thresholdBinary;
|
|
|
|
int gaussKernelSize;
|
2022-11-30 22:50:50 +01:00
|
|
|
|
2022-12-14 12:30:54 +01:00
|
|
|
void provideOutput(Mat originalImage, Mat processedImage, const FrameData& frameData, const Rect& roi, const int angle);
|
2022-11-03 09:23:30 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2022-11-10 20:55:23 +01:00
|
|
|
LFR() = delete;
|
2022-12-08 11:20:51 +01:00
|
|
|
LFR(int videoHeight, int videoWidth, int thresholdBinary, int gaussKernelSize);
|
2022-11-03 09:23:30 +01:00
|
|
|
~LFR();
|
|
|
|
|
2022-11-10 14:41:27 +01:00
|
|
|
void startLoop();
|
2022-11-03 09:23:30 +01:00
|
|
|
void endLoop();
|
2022-11-30 21:25:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
bool videoFlag;
|
|
|
|
bool saveOutputFlag;
|
|
|
|
|
|
|
|
std::string outputFileName;
|
2022-11-10 14:41:27 +01:00
|
|
|
|
2022-11-03 09:23:30 +01:00
|
|
|
};
|