|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #include <opencv2/core/utils/logger.hpp>
- #include <opencv2/opencv.hpp>
-
- #include <iostream>
-
- #include <input.h>
- #include <processing.h>
- #include <control_module.h>
- #include <interpreter.h>
- #include <intersection_handler.h>
-
- int main(void)
- {
- //Disable opencv logging messages
- cv::utils::logging::setLogLevel(cv::utils::logging::LOG_LEVEL_WARNING);
-
- const int thresholdBinary = 140;
- const int videoHeight = 720;
- const int videoWidth = 960;
- const int gaussKernelSize = 21;
- const int thresholdCanny1 = 50;
- const int thresholdCanny2 = 100;
- const int apertureSizeCanny = 3;
-
-
-
- Input input(videoHeight, videoWidth);
- Processing processing;
-
- namedWindow("Display window");
- while(true)
- {
- Mat image = input.readFile("Der\\Pfad\\zum\\Input\\Bilder\\Ordner\\auf\\deinem\\System");
- Mat processedImage = image;
- processing.processImage(processedImage, thresholdBinary, gaussKernelSize, thresholdCanny1, thresholdCanny2 ,apertureSizeCanny);
- std::vector<Vec4i> lines = processing.calculateLineSegments(processedImage);
- for( size_t i = 0; i < lines.size(); i++ )
- {
- line( image, Point(lines[i][0], lines[i][1]),
- Point( lines[i][2], lines[i][3]), (0,0,255), 1, 8 );
- }
- imshow("Display window", image);
- char c = (char)waitKey(1);
- }
- destroyWindow("Display window");
- input.freeWebcam();
- }
|