File tree Expand file tree Collapse file tree 8 files changed +88
-8
lines changed Expand file tree Collapse file tree 8 files changed +88
-8
lines changed Original file line number Diff line number Diff line change
1
+ #pragma once
2
+
3
+ int parseArguments (int argc, char **argv);
Original file line number Diff line number Diff line change
1
+ #pragma once
2
+
3
+ #include < opencv2/core/core.hpp>
4
+ #include < opencv2/highgui/highgui.hpp>
5
+ #include < opencv2/imgproc/imgproc.hpp>
6
+
7
+ using namespace cv ;
8
+
9
+ int getFrame (Mat& src);
10
+
11
+ int processFrame (const Mat& src, Mat& dst);
12
+
13
+ int show (const Mat& src, const Mat& dst);
Original file line number Diff line number Diff line change
1
+ #include < opencv2/core/core.hpp>
2
+ #include < iostream>
3
+
4
+ #include " auxiliaries.hpp"
5
+ #include " img_proc.hpp"
6
+
7
+ using namespace std ;
8
+ using namespace cv ;
9
+
10
+ int main (int argc, char **argv)
11
+ {
12
+ if (parseArguments (argc, argv) != 0 )
13
+ {
14
+ cout << " Incorrect input parameters!" << endl;
15
+ return 1 ;
16
+ }
17
+
18
+ Mat src, dst;
19
+
20
+ if (getFrame (src) != 0 )
21
+ {
22
+ cout << " Error: \' src\' image is null or empty!" << endl;
23
+ return 2 ;
24
+ }
25
+
26
+ processFrame (src, dst);
27
+
28
+ show (src, dst);
29
+
30
+ return 0 ;
31
+ }
Original file line number Diff line number Diff line change 1
- set (target ${PRACTICE1_LIBRARY } )
1
+ set (target ${PRACTICE2_LIBRARY } )
2
2
3
- FILE (GLOB hdrs "*.h*" "${PRACTICE1_INCLUDE } /*.h*" )
3
+ FILE (GLOB hdrs "*.h*" "${PRACTICE2_INCLUDE } /*.h*" )
4
4
FILE (GLOB srcs "*.cpp" )
5
5
6
6
ADD_LIBRARY (${target} STATIC ${srcs} ${hdrs} )
Original file line number Diff line number Diff line change
1
+ #include " auxiliaries.hpp"
2
+
3
+ int parseArguments (int argc, char **argv)
4
+ {
5
+ return 0 ;
6
+ }
Original file line number Diff line number Diff line change
1
+ #include " img_proc.hpp"
2
+
3
+ int getFrame (Mat& src)
4
+ {
5
+ return 0 ;
6
+ }
7
+
8
+ int processFrame (const Mat& src, Mat& dst)
9
+ {
10
+ return 0 ;
11
+ }
12
+
13
+ int show (const Mat& src, const Mat& dst)
14
+ {
15
+ return 0 ;
16
+ }
Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/gtest")
8
8
ADD_EXECUTABLE (${target} ${srcs} ${hdrs} )
9
9
TARGET_LINK_LIBRARIES (${target} gtest ${PRACTICE2_LIBRARY} )
10
10
11
- add_custom_command (
12
- TARGET ${PRACTICE2_TESTS}
13
- POST_BUILD
14
- COMMAND ln -fns "${CMAKE_SOURCE_DIR} /testdata" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE} /testdata"
15
- COMMENT "Adding a symbolic link to testdata"
16
- )
11
+ # add_custom_command(
12
+ # TARGET ${PRACTICE2_TESTS}
13
+ # POST_BUILD
14
+ # COMMAND ln -fns "${CMAKE_SOURCE_DIR}/testdata" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}/testdata"
15
+ # COMMENT "Adding a symbolic link to testdata"
16
+ # )
Original file line number Diff line number Diff line change
1
+ #include < gtest/gtest.h>
2
+ #include " auxiliaries.hpp"
3
+
4
+ TEST (practice2, parseArguments)
5
+ {
6
+ int argc = 0 ;
7
+ char **argv = 0 ;
8
+ int res = parseArguments (argc, argv);
9
+
10
+ EXPECT_EQ (0 , res);
11
+ }
You can’t perform that action at this time.
0 commit comments