Browse Source

split lfr in cpp and h file

pull/1/head
Tim Zeuner 2 years ago
parent
commit
d952629b39
2 changed files with 67 additions and 21 deletions
  1. 37
    21
      lfr.cpp
  2. 30
    0
      lfr.h

+ 37
- 21
lfr.cpp View File

@@ -1,29 +1,45 @@
#include <iostream>
#include <opencv2/opencv.hpp>
#include <input.h>
#include <processing.h>
#include <control_module.h>
#include <interpreter.h>
#include <intersection_handler.h>
#include "lfr.h"
const int threshold_binary = 110;

using namespace cv;
LFR::LFR() : iAmLooping(false), input(), processing(), controlModule(), interpreter(), intersectionHandler()
{

const int threshold_binary = 110;
}

int main(void)
LFR::~LFR()
{
//Set up
Input input;
Processing processing;
ControlModule controleModule;
Interpreter interpreter;
IntersectionHandler intersectionHandler;

//Mat image1 = input.readFile("C:\\Line-Following-Robot\\Test_data\\*.jpeg");
Mat image1 = input.readWebcam();
}

void LFR::loop()
{
//Give it 10 loops while async processing is not supported.
//while(iAmLooping)
for(int i = 0; i < 3; i++)
{
Mat image = input.readWebcam();
processing.calculate_binaray(image, threshold_binary);
imshow("Display window", image);
waitKey(0);
}
iAmLooping = false;
}

processing.calculate_binaray(image1, threshold_binary);
imshow("Display window", image1);
waitKey(0);
void LFR::startLoop()
{
this->loop();
}

void LFR::endLoop()
{
std::cout<<"The loop has been started. You may not dare to tell it to stop.";
}


int main(void)
{
//Mat image1 = input.readFile("C:\\Line-Following-Robot\\Test_data\\*.jpeg");

LFR lfr;
lfr.startLoop();
}

+ 30
- 0
lfr.h View File

@@ -0,0 +1,30 @@
#include <iostream>
#include <opencv2/opencv.hpp>
#include <input.h>
#include <processing.h>
#include <control_module.h>
#include <interpreter.h>
#include <intersection_handler.h>

using namespace cv;

class LFR
{
Input input;
Processing processing;
ControlModule controlModule;
Interpreter interpreter;
IntersectionHandler intersectionHandler;
bool iAmLooping;
void loop();

public:

LFR();
~LFR();

void startLoop();
void endLoop();


};

Loading…
Cancel
Save