Processing hinzugefügt V2

This commit is contained in:
Baran Yasar 2022-11-01 14:18:02 +01:00
parent b316d0ab81
commit d43cedf6f3
5 changed files with 36 additions and 4 deletions

View File

@ -7,15 +7,20 @@ enable_testing()
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/Input )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/Processing)
link_directories( ${Input_SOURCE_DIRS} )
link_directories( ${Processing_SOURCE_DIRS} )
add_subdirectory(Input)
add_subdirectory(Processing)
target_include_directories(Input PRIVATE .)
add_executable(lfr_image_processing lfr.cpp)
target_include_directories(Processing PRIVATE .)
add_executable(lfr_image_processing lfr.cpp)
target_link_libraries( lfr_image_processing ${OpenCV_LIBS})
target_link_libraries( lfr_image_processing Input )
target_link_libraries( lfr_image_processing Processing )
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})

View File

@ -25,8 +25,8 @@ Mat Input::readFile(String filePath)
Mat Input::readWebcam()
{
const int VID_HEIGHT = 1232;
const int VID_WIDTH = 1640;
const int VID_HEIGHT = 240;
const int VID_WIDTH = 320;
Mat image;
VideoCapture cap(0);
@ -36,9 +36,14 @@ Mat Input::readWebcam()
if(!cap.isOpened()) {
cout << "Fehler";
return Mat();
return Mat();
return Mat();
}
cap.read(image);
imshow("Display window", image);
waitKey(0);
return image;
}

12
Processing/CMakeLists.txt Normal file
View File

@ -0,0 +1,12 @@
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
add_library(Processing processing.cpp)
set_target_properties(Processing PROPERTIES VERSION ${PROJECT_VERSION})
target_include_directories(Processing PRIVATE .)
target_link_libraries( Processing ${OpenCV_LIBS})
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)

View File

@ -0,0 +1,9 @@
#include "processing.h"
processing::processing(/* args */)
{
}
processing::~processing()
{
}

View File

@ -3,6 +3,7 @@
#include <iostream>
#include <opencv2/opencv.hpp>
#include <input.h>
#include <processing.h>
using namespace cv;
@ -10,6 +11,6 @@ int main(void)
{
std::cout<<"Hello world";
Input test;
Mat image1 = test.readFile("C:\\Line-Following-Robot\\Test_data\\WhatsApp Image 2022-10-26 at 09.54.14.jpeg");
// Mat image1 = test.readFile("C:\\Line-Following-Robot\\Test_data\\WhatsApp Image 2022-10-26 at 09.54.14.jpeg");
Mat image2 = test.readWebcam();
}