Skip to content

Commit

Permalink
adds conf_build to opencv/examples/cpp #65
Browse files Browse the repository at this point in the history
  • Loading branch information
mxochicale committed May 30, 2024
1 parent eb90fb4 commit 6271e8a
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 76 deletions.
5 changes: 1 addition & 4 deletions opencv/examples/cpp/Multithread-Camera-OpenCV/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ v4l2-ctl --list-devices

## Build and run app
```
rm -rf build && mkdir -p build && cd build
cmake .. && make
./main
rm -rf build/
bash conf_build
```

## Gstreamer
Expand Down
16 changes: 16 additions & 0 deletions opencv/examples/cpp/Multithread-Camera-OpenCV/conf_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

## Setting paths
source_dir=$PWD
build_dir=${source_dir}/build
rm -rf $
mkdir -p $build_dir


## Configure
#cmake -S ${source_dir} -B ${build_dir} -D CMAKE_BUILD_TYPE=Release
cmake -S ${source_dir} -B ${build_dir} -G Ninja -D CMAKE_BUILD_TYPE=Release

## Build
cmake --build ${build_dir} -j

#ctest --test-dir ${build_dir}
6 changes: 0 additions & 6 deletions opencv/examples/cpp/hello-world/build.bash

This file was deleted.

16 changes: 16 additions & 0 deletions opencv/examples/cpp/hello-world/conf_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

## Setting paths
source_dir=$PWD
build_dir=${source_dir}/build
rm -rf $
mkdir -p $build_dir


## Configure
#cmake -S ${source_dir} -B ${build_dir} -D CMAKE_BUILD_TYPE=Release
cmake -S ${source_dir} -B ${build_dir} -G Ninja -D CMAKE_BUILD_TYPE=Release

## Build
cmake --build ${build_dir} -j

#ctest --test-dir ${build_dir}
2 changes: 1 addition & 1 deletion opencv/examples/cpp/hello-world/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
int main() {
std::cout << "Hello, OpenCV\n";

cv::Mat image = cv::imread("../lena.png", cv::IMREAD_GRAYSCALE);
cv::Mat image = cv::imread("lena.png", cv::IMREAD_GRAYSCALE);
if (image.empty()) {
std::cerr << "Image not found\n";
return 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@

## Build and run app
```
rm -rf build && mkdir -p build && cd build
cmake .. && make
./main
rm -rf build/
bash conf_build
```




## Reference
https://github.com/rbga/Multi-Threaded-Real-Time-Image-and-Video-Compression-using-OpenCV/blob/master/ConsoleApplication1/ConsoleApplication1.cpp

Expand Down
16 changes: 16 additions & 0 deletions opencv/examples/cpp/multi-threaded-video-compression/conf_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

## Setting paths
source_dir=$PWD
build_dir=${source_dir}/build
rm -rf $
mkdir -p $build_dir


## Configure
#cmake -S ${source_dir} -B ${build_dir} -D CMAKE_BUILD_TYPE=Release
cmake -S ${source_dir} -B ${build_dir} -G Ninja -D CMAKE_BUILD_TYPE=Release

## Build
cmake --build ${build_dir} -j

#ctest --test-dir ${build_dir}
16 changes: 16 additions & 0 deletions opencv/examples/cpp/triangulation_tests/conf_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

## Setting paths
source_dir=$PWD
build_dir=${source_dir}/build
rm -rf $
mkdir -p $build_dir


## Configure
#cmake -S ${source_dir} -B ${build_dir} -D CMAKE_BUILD_TYPE=Release
cmake -S ${source_dir} -B ${build_dir} -G Ninja -D CMAKE_BUILD_TYPE=Release

## Build
cmake --build ${build_dir} -j

#ctest --test-dir ${build_dir}
56 changes: 0 additions & 56 deletions opencv/examples/cpp/triangulation_tests/src/main_cpp

This file was deleted.

16 changes: 16 additions & 0 deletions opencv/examples/cpp/video-to-ascii-cpp/conf_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

## Setting paths
source_dir=$PWD
build_dir=${source_dir}/build
rm -rf ${build_dir}
mkdir -p $build_dir


## Configure
#cmake -S ${source_dir} -B ${build_dir} -G Ninja -D CMAKE_BUILD_TYPE=Release
cmake -S ${source_dir} -B ${build_dir} -G Ninja

## Build
cmake --build ${build_dir} -j

#ctest --test-dir ${build_dir}
4 changes: 2 additions & 2 deletions opencv/examples/cpp/videowriter_basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ Format Video Capture:

## clean, build and execute
```
bash build.bash
bash conf_build
```


## execute
```
./build/videowriter
./build/main
vlc live.avi
```

Expand Down
16 changes: 16 additions & 0 deletions opencv/examples/cpp/videowriter_basic/conf_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

## Setting paths
source_dir=$PWD
build_dir=${source_dir}/build
rm -rf ${build_dir}
mkdir -p $build_dir


## Configure
cmake -S ${source_dir} -B ${build_dir} -G Ninja -D CMAKE_BUILD_TYPE=Release
#cmake -S ${source_dir} -B ${build_dir} -G Ninja

## Build
cmake --build ${build_dir} -j

#ctest --test-dir ${build_dir}

0 comments on commit 6271e8a

Please sign in to comment.