123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #include "lfr.h"
-
- const int threshold_binary = 110;
-
- LFR::LFR() : iAmLooping(false), input(), processing(), controlModule(), interpreter(), intersectionHandler()
- {
- }
-
- LFR::~LFR()
- {
- if(iAmLooping)
- {
- this->endLoop();
- }
- }
-
- void LFR::loop()
- {
- namedWindow("Display window");
- while(iAmLooping)
- {
- Mat image = input.readWebcam();
- processing.calculate_binaray(image, threshold_binary);
- imshow("Display window", image);
- char c = (char)waitKey(1);
- }
- destroyWindow("Display window");
- input.freeWebcam();
- }
-
- void LFR::startLoop()
- {
- iAmLooping = true;
- this->loopThread=thread(&LFR::loop, this);
- }
-
- void LFR::endLoop()
- {
- iAmLooping = false;
- this->loopThread.join();
- return;
- }
|