Skip to content

Commit

Permalink
[Fix] Simple fixes from PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
zgjja committed Oct 17, 2024
1 parent f350547 commit ed7fde0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions docker/README → docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This folder contains the docker and docker-compose file to build the development

2. Build image:
```bash
docker compomse -f docker-compose.yml build
docker compose -f docker-compose.yml build
```

3. Run a container at background:
Expand Down Expand Up @@ -51,7 +51,7 @@ For more detail of the support matrix, please check [HERE](https://docs.nvidia.c

### How to customize opencv?

You can reconfigure and rebuild opencv sources in the container you created if any module is not included, without rebuilding the whole image, the source code is in `/workspace`
If prebuilt package from apt cannot meet your requirements, please refer to the demo code in `.dockerfile` to build opencv from source.

### How to solve image build fail issues?

Expand Down
38 changes: 20 additions & 18 deletions docker/x86_64.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,24 @@ RUN find /usr/local/share -type d -name "cmake-*" -exec rm -rf {} + \
&& curl -fsSL "https://github.com/Kitware/CMake/releases/download/v3.29.0/cmake-3.29.0-linux-x86_64.sh" \
-o cmake.sh && bash cmake.sh --skip-license --exclude-subdir --prefix=/usr/local && rm cmake.sh

## opencv contrib
RUN git clone -b 4.x https://github.com/opencv/opencv_contrib.git
RUN apt update && apt-get install -y \
libopencv-dev \
&& rm -rf /var/lib/apt/lists/*

## opencv
RUN git clone -b 4.x https://github.com/opencv/opencv.git opencv \
&& cmake -S opencv -B opencv/build -G Ninja \
-DBUILD_LIST=core,calib3d,imgproc,imgcodecs,highgui \
-DOPENCV_EXTRA_MODULES_PATH="/workspace/opencv_contrib/modules" \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DENABLE_FAST_MATH=ON \
-DOPENCV_GENERATE_PKGCONFIG=ON \
-DBUILD_opencv_python2=OFF \
-DBUILD_opencv_python3=OFF \
-DBUILD_JAVA=OFF \
-DBUILD_DOCS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_TESTS=OFF \
&& ninja -C opencv/build install
## a template to build opencv and opencv_contrib from source
# RUN git clone -b 4.x https://github.com/opencv/opencv_contrib.git \
# && git clone -b 4.x https://github.com/opencv/opencv.git opencv \
# && cmake -S opencv -B opencv/build -G Ninja \
# -DBUILD_LIST=core,calib3d,imgproc,imgcodecs,highgui \
# -DOPENCV_EXTRA_MODULES_PATH="/workspace/opencv_contrib/modules" \
# -DCMAKE_BUILD_TYPE=RELEASE \
# -DCMAKE_INSTALL_PREFIX=/usr/local \
# -DENABLE_FAST_MATH=ON \
# -DOPENCV_GENERATE_PKGCONFIG=ON \
# -DBUILD_opencv_python2=OFF \
# -DBUILD_opencv_python3=OFF \
# -DBUILD_JAVA=OFF \
# -DBUILD_DOCS=OFF \
# -DBUILD_PERF_TESTS=OFF \
# -DBUILD_TESTS=OFF \
# && ninja -C opencv/build install

0 comments on commit ed7fde0

Please sign in to comment.