Projektarbeit Line Following Robot bei Prof. Chowanetz im WS22/23
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lfr.cpp 677B

123456789101112131415161718192021222324252627282930313233343536
  1. #include "lfr.h"
  2. const int threshold_binary = 110;
  3. LFR::LFR() : iAmLooping(false), input(), processing(), controlModule(), interpreter(), intersectionHandler()
  4. {
  5. }
  6. LFR::~LFR()
  7. {
  8. }
  9. void LFR::loop()
  10. {
  11. //Give it 10 loops while async processing is not supported.
  12. //while(iAmLooping)
  13. for(int i = 0; i < 3; i++)
  14. {
  15. Mat image = input.readWebcam();
  16. processing.calculate_binaray(image, threshold_binary);
  17. imshow("Display window", image);
  18. waitKey(0);
  19. }
  20. iAmLooping = false;
  21. }
  22. void LFR::startLoop()
  23. {
  24. this->loop();
  25. }
  26. void LFR::endLoop()
  27. {
  28. std::cout<<"The loop has been started. You may not dare to tell it to stop.";
  29. }