Run AprilTools on linux
Hello, there!
I just did the cmake and the make in the source directory, but I dont know how to use the program in linux (Ubuntu). Do I need to follow the same instructions for windows users? For example: apriltools.exe --path "PATH_TO_THE_FOLDER_WITH_THE_IMAGE_SEQUENCE_INSIDE" --estimate-focal-length
If is not, what is the correct way to use the program in the command line?
Thanks.
You set the current path to the one you've built apriltools in (cd /path/to/apriltoolsdir), and then you use the same commands replacing apriltools.exe with ./apriltools
Hello BohdanOpyr. I try these changes but it didn't work. I know that I'm missing something stupid, but I can't find the mistake. I will show you everything I've done. First the make:
user@Taller:~/Descargas/AprilTools-master/apriltag-43ca2c4db31e685dcecb928d5f5ae7659677e98b$ mkdir build
user@Taller:~/Descargas/AprilTools-master/apriltag-43ca2c4db31e685dcecb928d5f5ae7659677e98b$ cd build
user@Taller:~/Descargas/AprilTools-master/apriltag-43ca2c4db31e685dcecb928d5f5ae7659677e98b/build$ cmake ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/Descargas/AprilTools-master/apriltag-43ca2c4db31e685dcecb928d5f5ae7659677e98b/build
user@Taller:~/Descargas/AprilTools-master/apriltag-43ca2c4db31e685dcecb928d5f5ae7659677e98b/build$ make
Scanning dependencies of target apriltag
[ 2%] Building C object CMakeFiles/apriltag.dir/apriltag.c.o
[ 5%] Building C object CMakeFiles/apriltag.dir/apriltag_pose.c.o
[ 8%] Building C object CMakeFiles/apriltag.dir/apriltag_quad_thresh.c.o
[ 11%] Building C object CMakeFiles/apriltag.dir/tag16h5.c.o
[ 14%] Building C object CMakeFiles/apriltag.dir/tag25h9.c.o
[ 17%] Building C object CMakeFiles/apriltag.dir/tag36h11.c.o
[ 20%] Building C object CMakeFiles/apriltag.dir/tagCircle21h7.c.o
[ 22%] Building C object CMakeFiles/apriltag.dir/tagCircle49h12.c.o
[ 25%] Building C object CMakeFiles/apriltag.dir/tagCustom48h12.c.o
[ 28%] Building C object CMakeFiles/apriltag.dir/tagStandard41h12.c.o
[ 31%] Building C object CMakeFiles/apriltag.dir/tagStandard52h13.c.o
[ 34%] Building C object CMakeFiles/apriltag.dir/common/g2d.c.o
[ 37%] Building C object CMakeFiles/apriltag.dir/common/getopt.c.o
[ 40%] Building C object CMakeFiles/apriltag.dir/common/homography.c.o
[ 42%] Building C object CMakeFiles/apriltag.dir/common/image_u8.c.o
[ 45%] Building C object CMakeFiles/apriltag.dir/common/image_u8x3.c.o
[ 48%] Building C object CMakeFiles/apriltag.dir/common/image_u8x4.c.o
[ 51%] Building C object CMakeFiles/apriltag.dir/common/matd.c.o
[ 54%] Building C object CMakeFiles/apriltag.dir/common/pam.c.o
[ 57%] Building C object CMakeFiles/apriltag.dir/common/pjpeg-idct.c.o
[ 60%] Building C object CMakeFiles/apriltag.dir/common/pjpeg.c.o
[ 62%] Building C object CMakeFiles/apriltag.dir/common/pnm.c.o
[ 65%] Building C object CMakeFiles/apriltag.dir/common/string_util.c.o
[ 68%] Building C object CMakeFiles/apriltag.dir/common/svd22.c.o
[ 71%] Building C object CMakeFiles/apriltag.dir/common/time_util.c.o
[ 74%] Building C object CMakeFiles/apriltag.dir/common/unionfind.c.o
[ 77%] Building C object CMakeFiles/apriltag.dir/common/workerpool.c.o
[ 80%] Building C object CMakeFiles/apriltag.dir/common/zarray.c.o
[ 82%] Building C object CMakeFiles/apriltag.dir/common/zhash.c.o
[ 85%] Building C object CMakeFiles/apriltag.dir/common/zmaxheap.c.o
[ 88%] Linking C shared library lib/libapriltag.so
[ 88%] Built target apriltag
Scanning dependencies of target apriltag_demo
[ 91%] Building C object CMakeFiles/apriltag_demo.dir/example/apriltag_demo.c.o
[ 94%] Linking C executable apriltag_demo
[ 94%] Built target apriltag_demo
Scanning dependencies of target opencv_demo
[ 97%] Building CXX object CMakeFiles/opencv_demo.dir/example/opencv_demo.cc.o
[100%] Linking CXX executable opencv_demo
[100%] Built target opencv_demo
Then I tested the comand you give me in the built directory:
user@Taller:~/Descargas/AprilTools-master/apriltag-43ca2c4db31e685dcecb928d5f5ae7659677e98b/build$ ls apriltag_demo CMakeCache.txt cmake_install.cmake Makefile apriltag.pc CMakeFiles lib opencv_demo user@Taller:~/Descargas/AprilTools-master/apriltag-43ca2c4db31e685dcecb928d5f5ae7659677e98b/build$ ./apriltools --path "/home/user/Descargas/AprilTools-master/testAnim" --estimate-focal-length bash: ./apriltools: No existe el archivo o el directorio
It didn't work. So I tested in the source directory:
user@Taller:~/Descargas/AprilTools-master/apriltag-43ca2c4db31e685dcecb928d5f5ae7659677e98b/build$ cd .. user@Taller:~/Descargas/AprilTools-master/apriltag-43ca2c4db31e685dcecb928d5f5ae7659677e98b$ ls apriltag.c CMakeLists.txt tag16h5.c tagCircle49h12.c apriltag.h common tag16h5.h tagCircle49h12.h apriltag_math.h example tag25h9.c tagCustom48h12.c apriltag.pc.in install.sh tag25h9.h tagCustom48h12.h apriltag_pose.c LICENSE.md tag36h11.c tagStandard41h12.c apriltag_pose.h Makefile tag36h11.h tagStandard41h12.h apriltag_quad_thresh.c package.xml tagCircle21h7.c tagStandard52h13.c build README.md tagCircle21h7.h tagStandard52h13.h user@Taller:~/Descargas/AprilTools-master/apriltag-43ca2c4db31e685dcecb928d5f5ae7659677e98b$ ./apriltools --path "/home/user/Descargas/AprilTools-master/testAnim" --estimate-focal-length bash: ./apriltools: No existe el archivo o el directorio
It didn't work. Finally I tested it in the main directory:
user@Taller:~/Descargas/AprilTools-master/apriltag-43ca2c4db31e685dcecb928d5f5ae7659677e98b$ cd .. user@Taller:~/Descargas/AprilTools-master$ ls apriltag bin README.md apriltag-43ca2c4db31e685dcecb928d5f5ae7659677e98b CMakeLists.txt testAnim AprilTools.cc LICENSE user@Taller:~/Descargas/AprilTools-master$ ./apriltools --path "/home/user/Descargas/AprilTools-master/testAnim" --estimate-focal-length bash: ./apriltools: No existe el archivo o el directorio user@Taller:~/Descargas/AprilTools-master$
And no results. Can you see the my mistake?
Thanks for you answer.
Maybe I'm just dumb but this is what I'm getting stuck on currently:
[c3ypt1c@x build]$ cmake ..
-- Found OpenCV: /usr (found version "4.4.0")
CMake Error at CMakeLists.txt:12 (add_subdirectory):
The source directory
/home/c3ypt1c/BuildSpace/AprilTools/AprilTools/apriltag
does not contain a CMakeLists.txt file.
-- Configuring incomplete, errors occurred!
See also "/home/c3ypt1c/BuildSpace/AprilTools/AprilTools/build/CMakeFiles/CMakeOutput.log".
I don't know what the CMakeLists.txt file is meant to be, as I'm not really a developer of this repository.
Log file is here: CMakeOutput.log. For now, I'll see if this runs with wine. Edit: doesn't run with wine.
Have you done this (takes a few minutes to build)?
cd ~
git clone --recursive https://github.com/thegoodhen/AprilTools
cd AprilTools
mkdir build
cd build
cmake ..
make
./apriltools
And then, whenever you need to use it:
cd ~/AprilTools/build
./apriltools --path ...
If not, try please. If tried, we are on the same page, and the failure is not your fault.
It built. The only difference is doing the --recursive for the git command. I'm sorry for being dumb.