|
1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #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()
- {
- //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);
- }
- }
-
- std::future<void> LFR::startLoop()
- {
- iAmLooping = true;
- std::cout<<"Loop start\n";
- return std::async(&LFR::loop, this);
- }
-
- void LFR::endLoop()
- {
- iAmLooping = false;
- std::cout<<"loop ende\n";
- return;
- }
|