Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenCV and Ceres versions #87

Merged
merged 10 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
MC_CALIB_PROD_DOCKER_IMG: bailool/mc-calib-prod:opencv420
MC_CALIB_DEV_DOCKER_IMG: bailool/mc-calib-dev:opencv420

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
clang-format-lint:
Expand All @@ -42,7 +46,7 @@ jobs:
- name: Run cppcheck
uses: addnab/docker-run-action@v3
with:
image: bailool/mc-calib-dev:latest
image: ${{env.MC_CALIB_DEV_DOCKER_IMG}}
options: -v ${{ github.workspace }}:/home/MC-Calib
run: |
cppcheck MC-Calib/McCalib/include
Expand All @@ -58,7 +62,7 @@ jobs:
- name: Run clang-tidy
uses: addnab/docker-run-action@v3
with:
image: bailool/mc-calib-dev:latest
image: ${{env.MC_CALIB_DEV_DOCKER_IMG}}
options: -v ${{ github.workspace }}:/home/MC-Calib
run: |
mkdir MC-Calib/build && cd MC-Calib/build
Expand Down Expand Up @@ -90,7 +94,7 @@ jobs:
- name: Run tests
uses: addnab/docker-run-action@v3
with:
image: bailool/mc-calib-dev:latest
image: ${{env.MC_CALIB_DEV_DOCKER_IMG}}
options: -v ${{ github.workspace }}:/home/MC-Calib
run: |
mkdir MC-Calib/build && cd MC-Calib/build
Expand Down Expand Up @@ -122,7 +126,7 @@ jobs:
- name: Run tests
uses: addnab/docker-run-action@v3
with:
image: bailool/mc-calib-dev:latest
image: ${{env.MC_CALIB_DEV_DOCKER_IMG}}
options: -v ${{ github.workspace }}:/home/MC-Calib
run: |
mkdir MC-Calib/build && cd MC-Calib/build
Expand Down Expand Up @@ -165,7 +169,7 @@ jobs:
- name: Run tests
uses: addnab/docker-run-action@v3
with:
image: bailool/mc-calib-prod:latest
image: ${{env.MC_CALIB_PROD_DOCKER_IMG}}
options: -v ${{ github.workspace }}:/home/MC-Calib:rw
run: |
mkdir MC-Calib/build && cd MC-Calib/build
Expand Down Expand Up @@ -228,7 +232,7 @@ jobs:
- name: Run tests
uses: addnab/docker-run-action@v3
with:
image: bailool/mc-calib-dev:latest
image: ${{env.MC_CALIB_DEV_DOCKER_IMG}}
options: -v ${{ github.workspace }}:${{ github.workspace }}
run: |
mkdir ${{ github.workspace }}/build && cd ${{ github.workspace }}/build
Expand Down Expand Up @@ -266,7 +270,7 @@ jobs:
- name: Run python linters
uses: addnab/docker-run-action@v3
with:
image: bailool/mc-calib-dev:latest
image: ${{env.MC_CALIB_DEV_DOCKER_IMG}}
options: -v ${{ github.workspace }}:/home/MC-Calib
run: |
cd MC-Calib/python_utils
Expand All @@ -292,7 +296,7 @@ jobs:
- name: Run python utils
uses: addnab/docker-run-action@v3
with:
image: bailool/mc-calib-prod:latest
image: ${{env.MC_CALIB_PROD_DOCKER_IMG}}
options: -v ${{ github.workspace }}:/home/MC-Calib:rw
run: |
cd MC-Calib/python_utils
Expand Down
42 changes: 25 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ubuntu:20.04 as prod
ENV DEBIAN_FRONTEND noninteractive
RUN apt update && apt install -y --no-install-recommends apt-utils && \
apt upgrade -y && apt autoremove -y && \
apt install -y build-essential cmake && \
apt install -y build-essential cmake wget unzip git && \
apt install -y python-is-python3 python3-pip && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -15,7 +15,14 @@ WORKDIR /home
#------------------------------ #
# INSTALL OPENCV 4 #
#------------------------------ #
RUN apt update && apt install -y libopencv-dev && \
RUN wget -O opencv.zip https://github.com/opencv/opencv/archive/4.2.0.zip && \
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.2.0.zip && \
unzip opencv.zip && unzip opencv_contrib.zip && \
mkdir -p build && cd build && \
cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.2.0/modules ../opencv-4.2.0 && \
cmake --build . --target install -- -j4 && \
cd /home && rm opencv.zip && rm opencv_contrib.zip && \
rm -rf opencv-4.2.0 && rm -rf opencv_contrib-4.2.0 && rm -rf build && \
rm -rf /var/lib/apt/lists/*

#------------------------------ #
Expand All @@ -27,36 +34,37 @@ RUN apt update && apt install -y libboost-all-dev && \
#------------------------------ #
# Install Ceres #
#------------------------------ #
RUN apt update && \
apt install -y libgoogle-glog-dev libgflags-dev libatlas-base-dev libeigen3-dev libsuitesparse-dev && \
RUN apt update && apt install -y libgoogle-glog-dev libgflags-dev libatlas-base-dev libeigen3-dev libsuitesparse-dev && \
rm -rf /var/lib/apt/lists/*
RUN apt update && apt install -y git && \
/bin/bash -c "git clone https://ceres-solver.googlesource.com/ceres-solver && \
RUN git clone --branch 20240722.0 --single-branch https://github.com/abseil/abseil-cpp.git && \
cd abseil-cpp && mkdir build && cd build && \
cmake .. && cmake --build . --target install -- -j4 && \
cd /home && rm -rf abseil-cpp && \
rm -rf /var/lib/apt/lists/*
RUN git clone --branch 2.2.0 --single-branch https://github.com/ceres-solver/ceres-solver.git && \
cd ceres-solver && mkdir build && cd build && cmake .. && \
make && make install && \
cd /home && rm -rf ceres-solver" && \
make -j4 && make -j4 install && \
cd /home && rm -rf ceres-solver && \
rm -rf /var/lib/apt/lists/*

# Install python requirements for python_utils scripts
RUN --mount=type=bind,source=python_utils/requirements_prod.txt,target=/tmp/requirements.txt \
pip install --requirement /tmp/requirements.txt && \
apt update && apt install -y libgl1 && \
python -m pip install --requirement /tmp/requirements.txt && \
rm -rf /var/lib/apt/lists/*

FROM prod as dev

RUN apt update && apt install -y python3-opencv && \
rm -rf /var/lib/apt/lists/*

#------------------------------ #
# Doxygen #
#------------------------------ #
RUN apt update && apt install -y flex bison && \
/bin/bash -c "git clone https://github.com/doxygen/doxygen.git && \
git clone https://github.com/doxygen/doxygen.git && \
cd doxygen && mkdir build && cd build &&\
cmake -G 'Unix Makefiles' .. && \
make && \
make install && \
cd /home && rm -rf doxygen" && \
make -j4 && \
make -j4 install && \
cd /home && rm -rf doxygen && \
rm -rf /var/lib/apt/lists/*

#------------------------------ #
Expand All @@ -67,5 +75,5 @@ RUN apt update && apt install -y cppcheck clang-tidy valgrind lcov && \

# Install python requirements for python_utils scripts
RUN --mount=type=bind,source=python_utils/requirements_dev.txt,target=/tmp/requirements.txt \
pip install --requirement /tmp/requirements.txt && \
python -m pip install --requirement /tmp/requirements.txt && \
rm -rf /var/lib/apt/lists/*
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Toolbox described in the paper ["MC-Calib: A generic and robust calibration tool

# Installation

Requirements: Ceres, Boost, OpenCV {4.2.x, 4.5.x}, c++17
Requirements: Ceres, Boost, OpenCV 4.2.0, c++17

For Windows users, follow [this installation guide](/docs/Windows.md)

Expand All @@ -20,8 +20,8 @@ There are several ways to get the environment ready. Choose any of them:
- Pull the image:

```bash
docker pull bailool/mc-calib-prod # production environment
docker pull bailool/mc-calib-dev # development environment
docker pull bailool/mc-calib-prod:opencv420 # production environment
docker pull bailool/mc-calib-dev:opencv420 # development environment
```

- Run pulled image (set `PATH_TO_REPO_ROOT` and `PATH_TO_DATA` appropriately):
Expand All @@ -31,14 +31,14 @@ There are several ways to get the environment ready. Choose any of them:
-ti --rm \
--volume="$PATH_TO_REPO_ROOT:/home/MC-Calib" \
--volume="$PATH_TO_DATA:/home/MC-Calib/data" \
bailool/mc-calib-prod
bailool/mc-calib-prod:opencv420
```

2. It is also possible to build the docker environment manually (see [instructions](/docs/Docker.md))

3. Alternatively, every dependency can be installed independently without docker:

- [Install](https://docs.opencv.org/4.5.2/d7/d9f/tutorial_linux_install.html) OpenCV 4.5.x. Either instal system-wide with `sudo make install` or link to your `build` in `CmakeLists.txt`.
- [Install](https://docs.opencv.org/4.2.0/d7/d9f/tutorial_linux_install.html) OpenCV 4.2.0. Either instal system-wide with `sudo make install` or link to your `build` in `CmakeLists.txt`.

- Follow [installation guidelines](http://ceres-solver.org/installation.html#linux) to install Ceres.

Expand Down
Loading