|
|
@@ -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(); |
|
|
|
} |