|
|
@@ -1,9 +1,9 @@ |
|
|
|
#include "lfr.h" |
|
|
|
|
|
|
|
const int threshold_binary = 110; |
|
|
|
|
|
|
|
LFR::LFR() : iAmLooping(false), input(), processing(), controlModule(), interpreter(), intersectionHandler() |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
LFR::~LFR() |
|
|
@@ -16,26 +16,27 @@ LFR::~LFR() |
|
|
|
|
|
|
|
void LFR::loop() |
|
|
|
{ |
|
|
|
//while(iAmLooping) |
|
|
|
for(int i = 0; i < 3; i++) |
|
|
|
namedWindow("Display window"); |
|
|
|
while(iAmLooping) |
|
|
|
{ |
|
|
|
Mat image = input.readWebcam(); |
|
|
|
processing.calculate_binaray(image, threshold_binary); |
|
|
|
imshow("Display window", image); |
|
|
|
waitKey(0); |
|
|
|
char c = (char)waitKey(1); |
|
|
|
} |
|
|
|
destroyWindow("Display window"); |
|
|
|
input.freeWebcam(); |
|
|
|
} |
|
|
|
|
|
|
|
std::future<void> LFR::startLoop() |
|
|
|
void LFR::startLoop() |
|
|
|
{ |
|
|
|
iAmLooping = true; |
|
|
|
std::cout<<"Loop start\n"; |
|
|
|
return std::async(&LFR::loop, this); |
|
|
|
this->loopThread=thread(&LFR::loop, this); |
|
|
|
} |
|
|
|
|
|
|
|
void LFR::endLoop() |
|
|
|
{ |
|
|
|
iAmLooping = false; |
|
|
|
std::cout<<"loop ende\n"; |
|
|
|
this->loopThread.join(); |
|
|
|
return; |
|
|
|
} |