Browse Source

Processing hinzugefügt V2

pull/1/head
Baran Yasar 2 years ago
parent
commit
d43cedf6f3
5 changed files with 36 additions and 4 deletions
  1. 6
    1
      CMakeLists.txt
  2. 7
    2
      Input/input.cpp
  3. 12
    0
      Processing/CMakeLists.txt
  4. 9
    0
      Processing/processing.cpp
  5. 2
    1
      lfr.cpp

+ 6
- 1
CMakeLists.txt 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})

+ 7
- 2
Input/input.cpp 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
- 0
Processing/CMakeLists.txt 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)

+ 9
- 0
Processing/processing.cpp View File

@@ -0,0 +1,9 @@
#include "processing.h"

processing::processing(/* args */)
{
}

processing::~processing()
{
}

+ 2
- 1
lfr.cpp 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();
}

Loading…
Cancel
Save