CCTag icon indicating copy to clipboard operation
CCTag copied to clipboard

[bug]Only one marker got detected

Open d5423197 opened this issue 6 months ago • 8 comments

I think there are more than 1 markers in sample image 2 but it only detects one. I just used the most updated code. (commit: 3cb3b00c1e31239758fe66ed453332e4e06a45f0)

(base) salus@p720u:/mnt/ssd/dzh/code/CCTag/build/Linux-x86_64$ ./detection -n 3 -i /mnt/ssd/dzh/code/CCTag/sample/02.png -u You called ./detection with: --input /mnt/ssd/dzh/code/CCTag/sample/02.png --nbrings 3 --bank --params --output --show-unreliable

******************* Image mode ********************** Total time: 0.870000s wall, 1.070000s user + 0.090000s system = 1.160000s CPU (133.3%)

#frame 0 Detected 1 candidates 1475.97 827.289 17 1

@simogasp Please take a look

d5423197 avatar Jun 17 '25 05:06 d5423197

Hi, sorry I don't have any machine to test it. I run it through codespace though, using the latest develop and everything seems to be in order:

# NOTE: since I cannot have a GUI in codespace I run it in batch mode over all the images of the sample directory

root@codespaces-b92e5a:/workspaces/CCTag/build# ./Linux-x86_64/detection -n 3 -u -s -i ../sample/
You called ./Linux-x86_64/detection with:
    --input     ../sample/
    --nbrings     3
    --bank      
    --params    
    --output    
    --save-detected-image
    --show-unreliable

Processing image "/workspaces/CCTag/build/../samplProcessing image "/workspacese/01.png"
/CCTag/build/../sample/02.png"
Total time:  0.599949s wall, 1.030000s user + 0.080000s system = 1.110000s CPU (185.0%)

#frame 0
Detected 5 candidates
884.71 812.053 0 1
932.139 963.587 15 1
15.2166 416.813 16 1
485.613 480.88 19 1
1148.57 885.466 20 1

5 markers detected and identified
Total time:  0.607506s wall, 1.030000s user + 0.090000s system = 1.120000s CPU (184.4%)

#frame 1
Detected 6 candidates
1450.03 666.796 6 1
408.463 782.559 11 1
1703.26 513.913 16 1
1476.04 827.232 17 1
785.155 875.716 22 1
947.194 769.55 25 1

6 markers detected and identified
Done processing image /workspaces/CCTag/build/../sample/02.png
Done processing image /workspaces/CCTag/build/../sample/01.png

Result for 01.png

Image

Result for 02.png

Image

Are you using the GPU version in your example? What configuration in terms of dependencies version are you using? This is obtained using the docker image of the dependencies, https://hub.docker.com/layers/alicevision/cctag-deps/cuda12.1.0-ubuntu22.04/images/sha256-d5bf767573055b94fb4c07870cca345ef450382299f924d14fa1b9d52823296b (see Dockerfile_deps at the root of the repository)

simogasp avatar Jun 18 '25 12:06 simogasp

@simogasp I followed the installation instruction from https://cctag.readthedocs.io/en/latest/install/install.html I am using the cpu version.

sudo apt-get install g++ git-all libpng12-dev libjpeg-dev libeigen3-dev libboost-all-dev libtbb-dev
mkdir build && cd build
cmake .. -DCCTAG_WITH_CUDA=OFF
make -j `nproc`

nothing special

the opencv version is: 4.6.0+dfsg-13.1ubuntu1

d5423197 avatar Jun 19 '25 03:06 d5423197

Just to be sure, I recompiled without CUDA and ran it, and I got the same result as before.

simogasp avatar Jun 19 '25 17:06 simogasp

I'm getting the same behavior when running the detection on the sample images. I ran the program in a Dockerimage with cuda support and recent libs with ubuntu 24.04. Maybe the behavior occurs with newer dependency versions?


These are my logs:

__@__/mrspace/detection/CCTag/sample# detection -n 3 -i .
You called detection with:
    --input     .
    --nbrings     3
    --bank      
    --params    
    --output    

Processing image "/mrspace/detection/CCTag/sample/./01.png"
Processing image "/mrspace/detection/CCTag/sample/./02.png"
Total time:  0.130000s wall, 0.250000s user + 0.050000s system = 0.300000s CPU (230.8%)

#frame 0
Detected 2 candidates
6.21819 208.232 -1 -1
485.529 480.847 19 1

1 markers detected and identified
Done processing image /mrspace/detection/CCTag/sample/./01.png
Total time:  0.160000s wall, 0.280000s user + 0.050000s system = 0.330000s CPU (206.2%)

#frame 1
Detected 2 candidates
738.971 413.566 -1 -1
1475.99 827.277 17 1

1 markers detected and identified
Done processing image /mrspace/detection/CCTag/sample/./02.png

This is the dockerfile i used for my testing.

Dockerfile:

ARG UBUNTU_VERSION=24.04
ARG NVIDIA_CUDA_VERSION=12.9.0

FROM nvidia/cuda:${NVIDIA_CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}

ARG CCTAG_GIT_COMMIT=v1.0.4

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get install -y \
        build-essential git cmake \
        yasm \
        libtool \
        nasm \
        libpng-dev \
        libjpeg-dev \
        ffmpeg \
        libssl-dev \
        libavcodec-dev \
        libavformat-dev \
        libswscale-dev \
        libopencv-dev \
        libboost-all-dev \
        libxcb-util0-dev \
        libtbb-dev

RUN git clone https://gitlab.com/libeigen/eigen --branch 3.4 && \
    mkdir eigen_build && \
    cd eigen_build && \
    cmake . ../eigen -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ && \
    make && make install && \
    cd .. && rm -rf eigen_build eigen

RUN git clone https://github.com/alicevision/CCTag.git && \
    cd CCTag && \
    git checkout v1.0.4 && \
    mkdir build && \
    cd build && \
    cmake .. -DCCTAG_WITH_CUDA:BOOL=ON \
        -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_SHARED_LIBS:BOOL=ON \
        -DCMAKE_PREFIX_PATH:PATH=/opt/ && make install -j$(nproc)

mariusre avatar Aug 03 '25 15:08 mariusre