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

find_package( OpenCV REQUIRED ) find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} ) include_directories( ${OpenCV_INCLUDE_DIRS} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/Input ) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/Input )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/Processing)
link_directories( ${Input_SOURCE_DIRS} ) link_directories( ${Input_SOURCE_DIRS} )
link_directories( ${Processing_SOURCE_DIRS} )


add_subdirectory(Input) add_subdirectory(Input)
add_subdirectory(Processing)
target_include_directories(Input PRIVATE .) 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 ${OpenCV_LIBS})
target_link_libraries( lfr_image_processing Input ) target_link_libraries( lfr_image_processing Input )
target_link_libraries( lfr_image_processing Processing )


set(CPACK_PROJECT_NAME ${PROJECT_NAME}) set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})

+ 7
- 2
Input/input.cpp View File



Mat Input::readWebcam() 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; Mat image;
VideoCapture cap(0); VideoCapture cap(0);


if(!cap.isOpened()) { if(!cap.isOpened()) {
cout << "Fehler"; cout << "Fehler";
return Mat(); return Mat();
return Mat();
return Mat();

} }


cap.read(image); cap.read(image);
imshow("Display window", image);
waitKey(0);


return image; return image;
} }

+ 12
- 0
Processing/CMakeLists.txt View File

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

#include "processing.h"

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

processing::~processing()
{
}

+ 2
- 1
lfr.cpp View File

#include <iostream> #include <iostream>
#include <opencv2/opencv.hpp> #include <opencv2/opencv.hpp>
#include <input.h> #include <input.h>
#include <processing.h>


using namespace cv; using namespace cv;


{ {
std::cout<<"Hello world"; std::cout<<"Hello world";
Input test; 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(); Mat image2 = test.readWebcam();
} }

Loading…
Cancel
Save