swatbotics / apriltag Goto Github PK
View Code? Open in Web Editor NEWExtensions and tweaks to APRIL Robotics Laboratory apriltag C software
Home Page: https://april.eecs.umich.edu/software/apriltag.html
License: Other
Extensions and tweaks to APRIL Robotics Laboratory apriltag C software
Home Page: https://april.eecs.umich.edu/software/apriltag.html
License: Other
I'm trying to install Apriltag with Python, and it keeps giving me an error during the build stage.
I'm on Windows 10, and the python wrapper for OpenCV 2 works for me.
Does anyone know how I could fix this?
Other people have had this problem too.
Here's the whole error log:
Installing collected packages: apriltag
Running setup.py install for apriltag ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\legoc\Desktop\Augmented Reality\env\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\legoc\\AppData\\Local\\Temp\\pip-install-0vcggsia\\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\\setup.py'"'"'; __file__='"'"'C:\\Users\\legoc\\AppData\\Local\\Temp\\pip-install-0vcggsia\\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\legoc\AppData\Local\Temp\pip-record-cyusenbz\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\legoc\Desktop\Augmented Reality\env\include\site\python3.8\apriltag'
cwd: C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\
Complete output (78 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
copying python\apriltag.py -> build\lib.win-amd64-3.8
running build_ext
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19041.
-- The C compiler identification is MSVC 19.27.29112.0
-- The CXX compiler identification is MSVC 19.27.29112.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - 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: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - 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 - not found
-- Found Threads: TRUE
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Checking for one of the modules 'opencv>=2.3;opencv-2.3.1;opencv-3.0.0'
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
PYTHON_EXECUTABLE
-- Build files have been written to: C:/Users/legoc/AppData/Local/Temp/pip-install-0vcggsia/apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa/build/temp.win-amd64-3.8/Release
Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(499,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\build\temp.win-amd64-3.8\Release\ZERO_CHECK.vcxproj]
Checking Build System
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(499,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\build\temp.win-amd64-3.8\Release\core\apriltag.vcxproj]
Building Custom Rule C:/Users/legoc/AppData/Local/Temp/pip-install-0vcggsia/apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa/core/CMakeLists.txt
cl : command line error D8021: invalid numeric argument '/Wsign-compare' [C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\build\temp.win-amd64-3.8\Release\core\apriltag.vcxproj]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\setup.py", line 62, in <module>
setup(
File "C:\Users\legoc\Desktop\Augmented Reality\env\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Program Files\Python38\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files\Python38\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\legoc\Desktop\Augmented Reality\env\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Program Files\Python38\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Program Files\Python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\Python38\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Program Files\Python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\setup.py", line 35, in run
self.build_extension(ext)
File "C:\Users\legoc\AppData\Local\Temp\pip-install-0vcggsia\apriltag_da105f092a3b4ae28f7e4c4a3c0e00fa\setup.py", line 60, in build_extension
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
File "C:\Program Files\Python38\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.
----------------------------------------```
Segmentation fault (core dumped)
This error pops up randomly while running the code. Sometimes, whole code runs without this. There is no change in parameters as well.
I am working on Nvidia Jetson Nano with picamv2 in 3264x2464@21fps.
families='tag36h11',
border=0,
nthreads=4,
quad_decimate=2.0,
quad_blur=1.0,
refine_edges=True,
refine_decode=False,
refine_pose=False,
debug=False,
quad_contours=False```
Can anyone tell me what is the unit of the tag size? meters?
This warning
...apriltag_quad_contour.c:467: warning: count < 8 :(
...happens all the time and clogs up the output. Does it mean anything that we really need to pay attention to? If not: could you remove it?
thx!
Hello,
Installed Aprtiltag according to the site and the demo worked fine but when I tried to run the script from https://pypi.org/project/apriltags/ , I get the following error:
Traceback (most recent call last):
File "ATtest.py", line 8, in
detector = Detector()
File "/home/odroid/apriltag-0.0.13/python/apriltag.py", line 272, in init
self.libc = ctypes.CDLL(filename)
File "/usr/lib/python2.7/ctypes/init.py", line 362, in init
self._handle = _dlopen(self._name, mode)
OSError: libapriltag.so: cannot open shared object file: No such file or directory
Exception AttributeError: "'Detector' object has no attribute 'libc'" in <bound method Detector.del of <apriltag.Detector object at 0xafd184d0>> ignored
any idea on how to fix the above error?
Thanks
first of all, thank you for writing an April Tag code in python.
My camera calibration values are fx, fy, cx, cy = (1600.686892782011, 1598.3654331406094, 640, 480)
Homography: [[ 2.92529352e-01 1.25090562e-01 5.47693202e+00]
[-5.70424844e-01 4.61686531e-01 3.91037508e+00]
[-4.98269301e-04 -4.78715645e-04 1.06762929e-02]]
Center: [512.99941666 366.26712251]
Corners: [[434.15356445 344.89123535]
[529.65270996 270.08859253]
[607.72912598 391.94927979]
[496.40701294 462.09399414]]
my homography matrix is accurate or not? because of the Homography matrix value change continuously.
if this matrix is accurate then how to find Pose data from the 3x3 matrix?
I have opencv 4 installed from source.
When I try to install apriltag it shows this below error during make -j4
prat@PratMAchin:~/apriltag/build$ make -j4
Scanning dependencies of target apriltag
[ 3%] Building C object core/CMakeFiles/apriltag.dir/apriltag_quad_thresh.c.o
[ 3%] Building C object core/CMakeFiles/apriltag.dir/apriltag.c.o
[ 5%] Building C object core/CMakeFiles/apriltag.dir/tag16h5.c.o
[ 7%] Building C object core/CMakeFiles/apriltag.dir/tag25h7.c.o
/home/prat/apriltag/core/apriltag.c: In function ‘rotate90’:
In file included from /home/prat/apriltag/core/apriltag_quad_thresh.c:44:0:
/home/prat/apriltag/core/common/unionfind.h: In function ‘unionfind_create’:
/home/prat/apriltag/core/apriltag.c:89:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int32_t c = 0; c < d; c++) {
^
/home/prat/apriltag/core/common/unionfind.h:63:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i <= maxid; i++) {
^
/home/prat/apriltag/core/apriltag.c: In function ‘quick_decode_init’:
/home/prat/apriltag/core/apriltag.c:180:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < family->ncodes; i++) {
^
/home/prat/apriltag/core/apriltag.c: In function ‘quad_decode’:
/home/prat/apriltag/core/apriltag.c:602:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int pattern_idx = 0; pattern_idx < sizeof(patterns)/(5*sizeof(float));
^
/home/prat/apriltag/core/apriltag.c:607:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < 2*family->black_border + family->d; i++) {
^
/home/prat/apriltag/core/apriltag.c:637:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int bitidx = 0; bitidx < family->d * family->d; bitidx++) {
^
[ 8%] Building C object core/CMakeFiles/apriltag.dir/tag25h9.c.o
/home/prat/apriltag/core/apriltag_quad_thresh.c: In function ‘apriltag_quad_thresh’:
/home/prat/apriltag/core/apriltag_quad_thresh.c:1705:51: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (unionfind_get_set_size(uf, v) < td->qtp.min_cluster_pixels)
^
[ 10%] Building C object core/CMakeFiles/apriltag.dir/tag36h10.c.o
[ 12%] Building C object core/CMakeFiles/apriltag.dir/tag36h11.c.o
[ 14%] Building C object core/CMakeFiles/apriltag.dir/tag36artoolkit.c.o
[ 15%] Building C object core/CMakeFiles/apriltag.dir/g2d.c.o
[ 17%] Building C object core/CMakeFiles/apriltag.dir/apriltag_family.c.o
[ 19%] Building C object core/CMakeFiles/apriltag.dir/common/zarray.c.o
[ 21%] Building C object core/CMakeFiles/apriltag.dir/common/zhash.c.o
/home/prat/apriltag/core/common/zhash.c: In function ‘zhash_get’:
/home/prat/apriltag/core/common/zhash.c:143:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < bucket->size; i++) {
^
/home/prat/apriltag/core/common/zhash.c: In function ‘zhash_get_volatile’:
/home/prat/apriltag/core/common/zhash.c:166:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < bucket->size; i++) {
^
/home/prat/apriltag/core/common/zhash.c: In function ‘zhash_put_real’:
/home/prat/apriltag/core/common/zhash.c:195:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < bucket->size; i++) {
^
/home/prat/apriltag/core/common/zhash.c: In function ‘zhash_remove’:
/home/prat/apriltag/core/common/zhash.c:245:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < bucket->size; i++) {
^
/home/prat/apriltag/core/common/zhash.c:262:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (i != bucket->size - 1) {
^
/home/prat/apriltag/core/common/zhash.c: In function ‘zhash_iterator_next_volatile’:
/home/prat/apriltag/core/common/zhash.c:368:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (zit->idx < bucket->size) {
^
[ 22%] Building C object core/CMakeFiles/apriltag.dir/common/zmaxheap.c.o
[ 24%] Building C object core/CMakeFiles/apriltag.dir/common/unionfind.c.o
[ 26%] Building C object core/CMakeFiles/apriltag.dir/common/matd.c.o
In file included from /home/prat/apriltag/core/common/unionfind.c:32:0:
/home/prat/apriltag/core/common/unionfind.h: In function ‘unionfind_create’:
/home/prat/apriltag/core/common/unionfind.h:63:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i <= maxid; i++) {
^
[ 28%] Building C object core/CMakeFiles/apriltag.dir/common/image_u8.c.o
/home/prat/apriltag/core/common/image_u8.c: In function ‘image_u8_write_pnm’:
/home/prat/apriltag/core/common/image_u8.c:181:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (im->width != fwrite(&im->buf[y*im->stride], 1, im->width, f)) {
^
[ 29%] Building C object core/CMakeFiles/apriltag.dir/common/pnm.c.o
[ 31%] Building C object core/CMakeFiles/apriltag.dir/common/image_f32.c.o
[ 33%] Building C object core/CMakeFiles/apriltag.dir/common/image_u32.c.o
[ 35%] Building C object core/CMakeFiles/apriltag.dir/common/workerpool.c.o
[ 36%] Building C object core/CMakeFiles/apriltag.dir/common/time_util.c.o
[ 38%] Building C object core/CMakeFiles/apriltag.dir/common/svd22.c.o
[ 40%] Building C object core/CMakeFiles/apriltag.dir/common/homography.c.o
[ 42%] Building C object core/CMakeFiles/apriltag.dir/common/string_util.c.o
/home/prat/apriltag/core/common/string_util.c: In function ‘str_diff_idx’:
/home/prat/apriltag/core/common/string_util.c:146:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (; i < minlen; i++)
^
/home/prat/apriltag/core/common/string_util.c: In function ‘str_tolowercase’:
/home/prat/apriltag/core/common/string_util.c:260:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < slen; i++) {
^
/home/prat/apriltag/core/common/string_util.c: In function ‘str_touppercase’:
/home/prat/apriltag/core/common/string_util.c:273:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < slen; i++) {
^
/home/prat/apriltag/core/common/string_util.c: In function ‘string_buffer_append’:
/home/prat/apriltag/core/common/string_util.c:306:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (sb->size+2 >= sb->alloc) {
^
/home/prat/apriltag/core/common/string_util.c: In function ‘string_buffer_append_string’:
/home/prat/apriltag/core/common/string_util.c:364:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while (sb->size+len + 1 >= sb->alloc) {
^
/home/prat/apriltag/core/common/string_util.c: In function ‘string_feeder_require’:
/home/prat/apriltag/core/common/string_util.c:517:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < len; i++) {
^
[ 43%] Building C object core/CMakeFiles/apriltag.dir/common/getopt.c.o
/home/prat/apriltag/core/common/string_util.c: In function ‘str_replace’:
/home/prat/apriltag/core/common/string_util.c:607:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while (pos < haystack_len) {
^
/home/prat/apriltag/core/common/getopt.c: In function ‘getopt_parse’:
/home/prat/apriltag/core/common/getopt.c:186:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while (i < zarray_size(toks)) {
^
/home/prat/apriltag/core/common/getopt.c:209:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ((i+1) < zarray_size(toks)) {
^
/home/prat/apriltag/core/common/getopt.c:231:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ((i+1) < zarray_size(toks)) {
^
/home/prat/apriltag/core/common/getopt.c:248:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (pos = 1; pos < len; pos++) {
^
/home/prat/apriltag/core/common/getopt.c:279:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ((i+1) < zarray_size(toks)) {
^
/home/prat/apriltag/core/common/getopt.c: In function ‘getopt_get_usage’:
/home/prat/apriltag/core/common/getopt.c:510:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (unsigned int i = 0; i < zarray_size(gopt->options); i++) {
^
/home/prat/apriltag/core/common/getopt.c:523:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (unsigned int i = 0; i < zarray_size(gopt->options); i++) {
^
[ 45%] Building C object core/CMakeFiles/apriltag.dir/contrib/box.c.o
[ 47%] Building C object core/CMakeFiles/apriltag.dir/contrib/contour.c.o
/home/prat/apriltag/core/contrib/contour.c: In function ‘contour_detect’:
/home/prat/apriltag/core/contrib/contour.c:450:25: warning: ‘j4’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (i4 == i && j4 == j && i3 == i1 && j3 == j1) {
^
/home/prat/apriltag/core/contrib/contour.c:450:16: warning: ‘i4’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (i4 == i && j4 == j && i3 == i1 && j3 == j1) {
^
[ 49%] Building C object core/CMakeFiles/apriltag.dir/contrib/lm.c.o
[ 50%] Building C object core/CMakeFiles/apriltag.dir/contrib/pdfutil.c.o
/home/prat/apriltag/core/contrib/pdfutil.c: In function ‘pdf_font_name’:
/home/prat/apriltag/core/contrib/pdfutil.c:867:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
[ 52%] Building C object core/CMakeFiles/apriltag.dir/contrib/apriltag_quad_contour.c.o
[ 54%] Building C object core/CMakeFiles/apriltag.dir/contrib/apriltag_vis.c.o
[ 56%] Building C object core/CMakeFiles/apriltag.dir/contrib/pose.c.o
[ 57%] Linking C shared library ../lib/libapriltag.so
[ 57%] Built target apriltag
Scanning dependencies of target contour_test
Scanning dependencies of target lm_test
Scanning dependencies of target apriltag_demo
Scanning dependencies of target pdf_test
[ 59%] Building CXX object core/CMakeFiles/lm_test.dir/contrib/lm_test.cpp.o
[ 61%] Building C object core/CMakeFiles/contour_test.dir/contrib/contour_test.c.o
[ 63%] Building CXX object core/CMakeFiles/pdf_test.dir/contrib/pdf_test.cpp.o
[ 64%] Building C object core/CMakeFiles/apriltag_demo.dir/apriltag_demo.c.o
[ 66%] Linking C executable ../contour_test
[ 68%] Linking CXX executable ../lm_test
[ 70%] Linking CXX executable ../pdf_test
[ 70%] Built target contour_test
[ 71%] Linking C executable ../apriltag_demo
Scanning dependencies of target maketags
[ 71%] Built target lm_test
[ 73%] Building C object core/CMakeFiles/maketags.dir/contrib/maketags.c.o
Scanning dependencies of target pose_test
[ 75%] Building C object core/CMakeFiles/pose_test.dir/contrib/pose_test.c.o
[ 75%] Built target pdf_test
Scanning dependencies of target apriltag_opencv
[ 75%] Built target apriltag_demo
[ 77%] Building CXX object opencv/CMakeFiles/apriltag_opencv.dir/apriltag_opencv.cpp.o
In file included from /home/prat/apriltag/opencv/apriltag_opencv.cpp:1:0:
/home/prat/apriltag/opencv/apriltag_opencv.h:7:33: fatal error: opencv2/core/core.hpp: No such file or directory
compilation terminated.
opencv/CMakeFiles/apriltag_opencv.dir/build.make:62: recipe for target 'opencv/CMakeFiles/apriltag_opencv.dir/apriltag_opencv.cpp.o' failed
make[2]: *** [opencv/CMakeFiles/apriltag_opencv.dir/apriltag_opencv.cpp.o] Error 1
CMakeFiles/Makefile2:574: recipe for target 'opencv/CMakeFiles/apriltag_opencv.dir/all' failed
make[1]: *** [opencv/CMakeFiles/apriltag_opencv.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 78%] Linking C executable ../maketags
[ 78%] Built target maketags
[ 80%] Linking C executable ../pose_test
[ 80%] Built target pose_test
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
While running the building code and after typing make -j4
line i got the error :
/usr/bin/ld: cannot find -lippicv collect2: error: ld returned 1 exit status opencv/CMakeFiles/apriltag_opencv.dir/build.make:95: recipe for target 'lib/libapriltag_opencv.so' failed make[2]: *** [lib/libapriltag_opencv.so] Error 1 CMakeFiles/Makefile2:382: recipe for target 'opencv/CMakeFiles/apriltag_opencv.dir/all' failed make[1]: *** [opencv/CMakeFiles/apriltag_opencv.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2
any help ?
I am not seeing any commented units in the source code for this function. After experimenting with it, it seems to be in inches. Is this correct?
in python. I type
import apriltag
detector = apriltag.Detector()
but when I type it, I got a Error message
selfdir is /usr/local/lib/python3.5/dist-packages
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.5/dist-packages/apriltag.py", line 272, in init
self.libc = ctypes.CDLL(filename)
File "/usr/lib/python3.5/ctypes/init.py", line 347, in init
self._handle = _dlopen(self._name, mode)
OSError: libapriltag.so: cannot open shared object file: No such file or directory
how can I fix that?
I followed instruction and the error occurred after make -j4
[100%] Linking C executable apriltag_demo
clang: error: no such file or directory: '/Users/joshzheng/Box Sync/Documents/Hanabi/apriltag/build/lib/libapriltag.so'
Hi,
When I run the command
build make -j4
I get the error
clang: error: the clang compiler does not support '-march=native'
Here's the full output:
➜ build make -j4
[ 4%] Building C object core/CMakeFiles/apriltag.dir/apriltag.c.o
[ 8%] Building C object core/CMakeFiles/apriltag.dir/tag25h7.c.o
[ 8%] Building C object core/CMakeFiles/apriltag.dir/tag16h5.c.o
[ 8%] Building C object core/CMakeFiles/apriltag.dir/apriltag_quad_thresh.c.o
clang: error: the clang compiler does not support '-march=native'
clang: error: the clang compiler does not support '-march=native'
clang: error: the clang compiler does not support '-march=native'
clang: error: the clang compiler does not support '-march=native'
make[2]: *** [core/CMakeFiles/apriltag.dir/apriltag.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [core/CMakeFiles/apriltag.dir/apriltag_quad_thresh.c.o] Error 1
make[2]: *** [core/CMakeFiles/apriltag.dir/tag25h7.c.o] Error 1
make[2]: *** [core/CMakeFiles/apriltag.dir/tag16h5.c.o] Error 1
make[1]: *** [core/CMakeFiles/apriltag.dir/all] Error 2
make: *** [all] Error 2
I'm on a M1 Mac Max 16 inch.
I tried this with two versions of clang; the first one being the one that is installed with xcode:
➜ macx-stable-diffusion > clang -v
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
and then one installed with brew via brew install llvm
:
➜ build clang -v
Homebrew clang version 15.0.0
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /opt/homebrew/opt/llvm/bin
I was able to get this library to work on my Intel 2013 macbook, but not the 2021 16 inch Mac Max.
What am I doing wrong?
Hi there,
I use your python module to detect marker, it works fine on tag with border=1. However, when I use the calibration pattern from ETHZ Kalibr(a calibration tool) here, whose pattern border is 2, the python module detected nothing.
I've checked the pattern parameters, like family tag36h11, start with ID=30. Could you please kindly give me some suggestions?
Here is my code:
import apriltag
import cv2
if __name__ == "__main__":
from sys import argv
if len(argv) < 2:
print("example: python tag_recognition.py path/to/img.png")
quit()
img_filename = argv[1]
img = cv2.imread(img_filename, cv2.IMREAD_GRAYSCALE)
options = apriltag.DetectorOptions(families='tag36h11',
border=2,
nthreads=4,
quad_decimate=1.0,
quad_blur=0.0,
refine_edges=True,
refine_decode=False,
refine_pose=False,
debug=True,
quad_contours=True)
detector = apriltag.Detector(options = options)
result = detector.detect(img)
print(result)
I experienced an error during the make command.
The error on make is the following:
Scanning dependencies of target apriltag
[ 3%] Building C object core/CMakeFiles/apriltag.dir/apriltag.c.o
[ 5%] Building C object core/CMakeFiles/apriltag.dir/tag25h7.c.o
[ 3%] Building C object core/CMakeFiles/apriltag.dir/tag16h5.c.o
[ 7%] Building C object core/CMakeFiles/apriltag.dir/apriltag_quad_thresh.c.o
In file included from /data/melnichenko/Progs/apriltag/core/common/timeprofile.h:44:0,
from /data/melnichenko/Progs/apriltag/core/apriltag.h:45,
from /data/melnichenko/Progs/apriltag/core/tag25h7.c:36:
/data/melnichenko/Progs/apriltag/core/common/time_util.h:48:45: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
void utime_to_timespec(int64_t v, struct timespec *ts);
^~~~~~~~
In file included from /data/melnichenko/Progs/apriltag/core/common/timeprofile.h:44:0,
from /data/melnichenko/Progs/apriltag/core/apriltag.h:45,
from /data/melnichenko/Progs/apriltag/core/tag16h5.c:36:
/data/melnichenko/Progs/apriltag/core/common/time_util.h:48:45: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
void utime_to_timespec(int64_t v, struct timespec *ts);
^~~~~~~~
/data/melnichenko/Progs/apriltag/core/tag25h7.c: In function ‘tag25h7_create’:
/data/melnichenko/Progs/apriltag/core/tag25h7.c:41:15: warning: implicit declaration of function ‘strdup’; did you mean ‘strcmp’? [-Wimplicit-function-declaration]
tf->name = strdup("tag25h7");
^~~~~~
strcmp
/data/melnichenko/Progs/apriltag/core/tag25h7.c:41:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
tf->name = strdup("tag25h7");
^
/data/melnichenko/Progs/apriltag/core/tag16h5.c: In function ‘tag16h5_create’:
/data/melnichenko/Progs/apriltag/core/tag16h5.c:41:15: warning: implicit declaration of function ‘strdup’; did you mean ‘strcmp’? [-Wimplicit-function-declaration]
tf->name = strdup("tag16h5");
^~~~~~
strcmp
/data/melnichenko/Progs/apriltag/core/tag16h5.c:41:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
tf->name = strdup("tag16h5");
^
In file included from /data/melnichenko/Progs/apriltag/core/common/timeprofile.h:44:0,
from /data/melnichenko/Progs/apriltag/core/apriltag.h:45,
from /data/melnichenko/Progs/apriltag/core/apriltag.c:32:
/data/melnichenko/Progs/apriltag/core/common/time_util.h:48:45: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
void utime_to_timespec(int64_t v, struct timespec *ts);
^~~~~~~~
/data/melnichenko/Progs/apriltag/core/apriltag.c: In function ‘rotate90’:
/data/melnichenko/Progs/apriltag/core/apriltag.c:89:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int32_t c = 0; c < d; c++) {
^
/data/melnichenko/Progs/apriltag/core/apriltag.c: In function ‘quick_decode_init’:
/data/melnichenko/Progs/apriltag/core/apriltag.c:180:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < family->ncodes; i++) {
^
/data/melnichenko/Progs/apriltag/core/apriltag.c: In function ‘quad_decode’:
/data/melnichenko/Progs/apriltag/core/apriltag.c:602:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int pattern_idx = 0; pattern_idx < sizeof(patterns)/(5*sizeof(float)); pattern_idx ++) {
^
/data/melnichenko/Progs/apriltag/core/apriltag.c:607:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < 2*family->black_border + family->d; i++) {
^
/data/melnichenko/Progs/apriltag/core/apriltag.c:637:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int bitidx = 0; bitidx < family->d * family->d; bitidx++) {
^
/data/melnichenko/Progs/apriltag/core/apriltag.c: In function ‘apriltag_detector_detect’:
/data/melnichenko/Progs/apriltag/core/apriltag.c:1129:9: warning: implicit declaration of function ‘srandom’; did you mean ‘srand’? [-Wimplicit-function-declaration]
srandom(0);
^~~~~~~
srand
/data/melnichenko/Progs/apriltag/core/apriltag.c:1136:33: warning: implicit declaration of function ‘random’; did you mean ‘randf’? [-Wimplicit-function-declaration]
int color = bias + (random() % (255-bias));
^~~~~~
randf
[ 9%] Building C object core/CMakeFiles/apriltag.dir/tag25h9.c.o
In file included from /data/melnichenko/Progs/apriltag/core/apriltag_quad_thresh.c:44:0:
/data/melnichenko/Progs/apriltag/core/common/unionfind.h: In function ‘unionfind_create’:
/data/melnichenko/Progs/apriltag/core/common/unionfind.h:63:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i <= maxid; i++) {
^~
/data/melnichenko/Progs/apriltag/core/apriltag_quad_thresh.c: In function ‘apriltag_quad_thresh’:
/data/melnichenko/Progs/apriltag/core/apriltag_quad_thresh.c:1705:51: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (unionfind_get_set_size(uf, v) < td->qtp.min_cluster_pixels)
^
In file included from /data/melnichenko/Progs/apriltag/core/common/timeprofile.h:44:0,
from /data/melnichenko/Progs/apriltag/core/apriltag.h:45,
from /data/melnichenko/Progs/apriltag/core/tag25h9.c:36:
/data/melnichenko/Progs/apriltag/core/common/time_util.h:48:45: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
void utime_to_timespec(int64_t v, struct timespec *ts);
^~~~~~~~
/data/melnichenko/Progs/apriltag/core/tag25h9.c: In function ‘tag25h9_create’:
/data/melnichenko/Progs/apriltag/core/tag25h9.c:41:15: warning: implicit declaration of function ‘strdup’; did you mean ‘strcmp’? [-Wimplicit-function-declaration]
tf->name = strdup("tag25h9");
^~~~~~
strcmp
/data/melnichenko/Progs/apriltag/core/tag25h9.c:41:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
tf->name = strdup("tag25h9");
^
[ 11%] Building C object core/CMakeFiles/apriltag.dir/tag36h10.c.o
[ 13%] Building C object core/CMakeFiles/apriltag.dir/tag36h11.c.o
In file included from /data/melnichenko/Progs/apriltag/core/common/timeprofile.h:44:0,
from /data/melnichenko/Progs/apriltag/core/apriltag.h:45,
from /data/melnichenko/Progs/apriltag/core/tag36h10.c:36:
/data/melnichenko/Progs/apriltag/core/common/time_util.h:48:45: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
void utime_to_timespec(int64_t v, struct timespec *ts);
^~~~~~~~
/data/melnichenko/Progs/apriltag/core/tag36h10.c: In function ‘tag36h10_create’:
/data/melnichenko/Progs/apriltag/core/tag36h10.c:41:15: warning: implicit declaration of function ‘strdup’; did you mean ‘strcmp’? [-Wimplicit-function-declaration]
tf->name = strdup("tag36h10");
^~~~~~
strcmp
/data/melnichenko/Progs/apriltag/core/tag36h10.c:41:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
tf->name = strdup("tag36h10");
^
In file included from /data/melnichenko/Progs/apriltag/core/common/timeprofile.h:44:0,
from /data/melnichenko/Progs/apriltag/core/apriltag.h:45,
from /data/melnichenko/Progs/apriltag/core/tag36h11.c:36:
/data/melnichenko/Progs/apriltag/core/common/time_util.h:48:45: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
void utime_to_timespec(int64_t v, struct timespec *ts);
^~~~~~~~
/data/melnichenko/Progs/apriltag/core/tag36h11.c: In function ‘tag36h11_create’:
/data/melnichenko/Progs/apriltag/core/tag36h11.c:41:15: warning: implicit declaration of function ‘strdup’; did you mean ‘strcmp’? [-Wimplicit-function-declaration]
tf->name = strdup("tag36h11");
^~~~~~
strcmp
/data/melnichenko/Progs/apriltag/core/tag36h11.c:41:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
tf->name = strdup("tag36h11");
^
[ 15%] Building C object core/CMakeFiles/apriltag.dir/tag36artoolkit.c.o
[ 17%] Building C object core/CMakeFiles/apriltag.dir/g2d.c.o
In file included from /data/melnichenko/Progs/apriltag/core/common/timeprofile.h:44:0,
from /data/melnichenko/Progs/apriltag/core/apriltag.h:45,
from /data/melnichenko/Progs/apriltag/core/tag36artoolkit.c:35:
/data/melnichenko/Progs/apriltag/core/common/time_util.h:48:45: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
void utime_to_timespec(int64_t v, struct timespec *ts);
^~~~~~~~
/data/melnichenko/Progs/apriltag/core/tag36artoolkit.c: In function ‘tag36artoolkit_create’:
/data/melnichenko/Progs/apriltag/core/tag36artoolkit.c:40:16: warning: implicit declaration of function ‘strdup’; did you mean ‘strcmp’? [-Wimplicit-function-declaration]
tf->name = strdup("artoolkit");
^~~~~~
strcmp
/data/melnichenko/Progs/apriltag/core/tag36artoolkit.c:40:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
tf->name = strdup("artoolkit");
^
[ 19%] Building C object core/CMakeFiles/apriltag.dir/apriltag_family.c.o
In file included from /data/melnichenko/Progs/apriltag/core/common/timeprofile.h:44:0,
from /data/melnichenko/Progs/apriltag/core/apriltag.h:45,
from /data/melnichenko/Progs/apriltag/core/apriltag_family.c:1:
/data/melnichenko/Progs/apriltag/core/common/time_util.h:48:45: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
void utime_to_timespec(int64_t v, struct timespec *ts);
^~~~~~~~
[ 21%] Building C object core/CMakeFiles/apriltag.dir/common/zarray.c.o
[ 23%] Building C object core/CMakeFiles/apriltag.dir/common/zhash.c.o
[ 25%] Building C object core/CMakeFiles/apriltag.dir/common/zmaxheap.c.o
/data/melnichenko/Progs/apriltag/core/common/zhash.c: In function ‘zhash_get’:
/data/melnichenko/Progs/apriltag/core/common/zhash.c:143:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < bucket->size; i++) {
^
/data/melnichenko/Progs/apriltag/core/common/zhash.c: In function ‘zhash_get_volatile’:
/data/melnichenko/Progs/apriltag/core/common/zhash.c:166:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < bucket->size; i++) {
^
/data/melnichenko/Progs/apriltag/core/common/zhash.c: In function ‘zhash_put_real’:
/data/melnichenko/Progs/apriltag/core/common/zhash.c:195:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < bucket->size; i++) {
^
/data/melnichenko/Progs/apriltag/core/common/zhash.c: In function ‘zhash_remove’:
/data/melnichenko/Progs/apriltag/core/common/zhash.c:245:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < bucket->size; i++) {
^
/data/melnichenko/Progs/apriltag/core/common/zhash.c:262:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (i != bucket->size - 1) {
^~
/data/melnichenko/Progs/apriltag/core/common/zhash.c: In function ‘zhash_iterator_next_volatile’:
/data/melnichenko/Progs/apriltag/core/common/zhash.c:368:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (zit->idx < bucket->size) {
^
/data/melnichenko/Progs/apriltag/core/common/zmaxheap.c: In function ‘zmaxheap_test’:
/data/melnichenko/Progs/apriltag/core/common/zmaxheap.c:369:14: warning: implicit declaration of function ‘random’; did you mean ‘rand’? [-Wimplicit-function-declaration]
if ((random() & 1) == 0 && sz < cap) {
^~~~~~
rand
[ 26%] Building C object core/CMakeFiles/apriltag.dir/common/unionfind.c.o
In file included from /data/melnichenko/Progs/apriltag/core/common/unionfind.c:32:0:
/data/melnichenko/Progs/apriltag/core/common/unionfind.h: In function ‘unionfind_create’:
/data/melnichenko/Progs/apriltag/core/common/unionfind.h:63:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i <= maxid; i++) {
^~
[ 28%] Building C object core/CMakeFiles/apriltag.dir/common/matd.c.o
[ 30%] Building C object core/CMakeFiles/apriltag.dir/common/image_u8.c.o
/data/melnichenko/Progs/apriltag/core/common/image_u8.c: In function ‘image_u8_write_pnm’:
/data/melnichenko/Progs/apriltag/core/common/image_u8.c:181:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (im->width != fwrite(&im->buf[y*im->stride], 1, im->width, f)) {
^~
[ 32%] Building C object core/CMakeFiles/apriltag.dir/common/pnm.c.o
[ 34%] Building C object core/CMakeFiles/apriltag.dir/common/image_f32.c.o
[ 36%] Building C object core/CMakeFiles/apriltag.dir/common/image_u32.c.o
[ 38%] Building C object core/CMakeFiles/apriltag.dir/common/workerpool.c.o
[ 40%] Building C object core/CMakeFiles/apriltag.dir/common/time_util.c.o
In file included from /data/melnichenko/Progs/apriltag/core/common/time_util.c:32:0:
/data/melnichenko/Progs/apriltag/core/common/time_util.h:48:45: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
void utime_to_timespec(int64_t v, struct timespec *ts);
^~~~~~~~
/data/melnichenko/Progs/apriltag/core/common/time_util.c:57:2: error: invalid preprocessing directive #void
#void utime_to_timespec(int64_t v, struct timespec *ts)
^~~~
/data/melnichenko/Progs/apriltag/core/common/time_util.c:58:2: error: invalid preprocessing directive #{
#{
^
/data/melnichenko/Progs/apriltag/core/common/time_util.c:59:6: error: invalid preprocessing directive #ts
# ts->tv_sec = (time_t) utime_get_seconds(v);
^~
/data/melnichenko/Progs/apriltag/core/common/time_util.c:60:6: error: invalid preprocessing directive #ts
# ts->tv_nsec = (suseconds_t) utime_get_useconds(v)*1000;
^~
/data/melnichenko/Progs/apriltag/core/common/time_util.c:61:2: error: invalid preprocessing directive #}
#}
^
/data/melnichenko/Progs/apriltag/core/common/time_util.c: In function ‘timeutil_usleep’:
/data/melnichenko/Progs/apriltag/core/common/time_util.c:66:12: warning: implicit declaration of function ‘usleep’; did you mean ‘sleep’? [-Wimplicit-function-declaration]
return usleep(useconds);
^~~~~~
sleep
core/CMakeFiles/apriltag.dir/build.make:542: recipe for target 'core/CMakeFiles/apriltag.dir/common/time_util.c.o' failed
make[2]: *** [core/CMakeFiles/apriltag.dir/common/time_util.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:93: recipe for target 'core/CMakeFiles/apriltag.dir/all' failed
make[1]: *** [core/CMakeFiles/apriltag.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
The output of cmake is the following:
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.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
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for one of the modules 'opencv>=2.3;opencv-2.3.1;opencv-3.0.0'
-- Configuring done
-- Generating done
-- Build files have been written to: /data/melnichenko/Progs/apriltag/build
I found that this issue can be fixed for me by commenting/deleting the function
void utime_to_timespec(int64_t v, struct timespec *ts)
i.e lines 57-61 of core/common/time_util.c
Than you for your work.
Best regards, Alexandra.
Hey, I wanted to know in what way I could find the distance between the camera and a tag using these codes
Ok, I found a few more leaks and fixed them in commit 15db309 – I also discovered the https://pypi.org/project/memory_profiler/ module along with its tool mprof which helped. Please let me know if you still see increasing memory usage over time.
Originally posted by @mzucker in #6 (comment)
apriltag-ros crashed after add this --- image_u8_destroy(im_orig);
I'm running into an issue where it can find the library. I'm using the standard tag36h11 family, but it still raises the same issue. It seems like it's a pointer issue, but I don't know any C++ so I'm having difficulty troubleshooting it.
Any feedback would be greatly appreciated.
Thanks!
Hi,
This looks like great software - would you be able to provide a licence file for it? I would be keen for it to have a BSD, MIT or Apache license, allowing for commercial use :)
Thanks
Just like I said, will be possible or not?
https://github.com/AprilRobotics/apriltags
Hello, I was playing around with a script for one of my project. Unfortunately, the program leaks memory and its exponential. I am not a C programmer. I could find the leak.
Here is my python script-
import cv2
import apriltag
capt = cv2.VideoCapture("some_video_stream")
detec = apriltag.Detector()
while capt.isOpened():
ret, frame = capt.read()
# converting image to gray scale
gray = cv2.cvtColor(frame, `cv2.COLOR_BGR2GRAY)`
# passing it to function in apriltag.py
**detected_codes_in_image = detec.detect(gray)**
#some display function
if cv2.waitKey(1) & 0xFF == ord('q'):
break
I could trace it with resource package in python
code in apriltag.py where the issue occurs. its the
self.libc.apriltag_detector_detect(self.tag_detector, c_img)
class Detector(object): # this class
def detect(self, img, return_image=False): # this function
'''Run detectons on the provided image. The image must be a grayscale
image of type numpy.uint8.'''
assert len(img.shape) == 2
assert img.dtype == numpy.uint8
c_img = self._convert_image(img)
# this line increases memory after few iteration.
detections = self.libc.apriltag_detector_detect(self.tag_detector, c_img)
#create a pytags_info object
return_info = []
for i in range(0, detections.contents.size):
#extract the data for each apriltag that was identified
apriltag = ctypes.POINTER(_ApriltagDetection)()
self.libc.zarray_get(detections, i, ctypes.byref(apriltag))
tag = apriltag.contents
homography = _matd_get_array(tag.H).copy()
center = numpy.ctypeslib.as_array(tag.c, shape=(2,)).copy()
corners = numpy.ctypeslib.as_array(tag.p, shape=(4, 2)).copy()
detection = Detection(
tag.family.contents.name,
tag.id,
tag.hamming,
tag.goodness,
tag.decision_margin,
homography,
center,
corners)
#Append this dict to the tag data array
return_info.append(detection)
"pip install apriltag" results in the following error
C:\WINDOWS\system32>pip install apriltag
Collecting apriltag
Downloading https://files.pythonhosted.org/packages/82/1a/da64bbf4b78790ca827471f93cf20602182506277cf236487c903dea3d5e/apriltag-0.0.13.tar.gz (187kB)
100% |████████████████████████████████| 194kB 6.8MB/s
Building wheels for collected packages: apriltag
Running setup.py bdist_wheel for apriltag ... error
Complete output from command c:\users\superhhu\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;file='C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d C:\Users\superhhu\AppData\Local\Temp\pip-wheel-6i82e0uj --python-tag cp36:
c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
copying python\apriltag.py -> build\lib.win-amd64-3.6
running build_ext
-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version to target Windows 10.0.17134.
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- 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 - not found
-- Found Threads: TRUE
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Checking for one of the modules 'opencv>=2.3;opencv-2.3.1;opencv-3.0.0'
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
PYTHON_EXECUTABLE
-- Build files have been written to: C:/Users/superhhu/AppData/Local/Temp/pip-install-d2f0nww7/apriltag/build/temp.win-amd64-3.6/Release
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 7/13/2018 8:48:17 AM.
1>Project "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" on node 1 (default targets).
1>Project "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" (1) is building "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
2>PrepareForBuild:
Creating directory "x64\Release\ZERO_CHECK".
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(400,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ZERO_CHECK.vcxproj]
Creating directory "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog".
InitializeBuildStatus:
Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
Checking Build System
CMake does not need to re-run because C:/Users/superhhu/AppData/Local/Temp/pip-install-d2f0nww7/apriltag/build/temp.win-amd64-3.6/Release/CMakeFiles/generate.stamp is up-to-date.
CMake does not need to re-run because C:/Users/superhhu/AppData/Local/Temp/pip-install-d2f0nww7/apriltag/build/temp.win-amd64-3.6/Release/core/CMakeFiles/generate.stamp is up-to-date.
FinalizeBuildStatus:
Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
2>Done Building Project "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ZERO_CHECK.vcxproj" (default targets).
1>Project "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" (1) is building "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj" (4) on node 2 (default targets).
4>PrepareForBuild:
Creating directory "apriltag.dir\Release".
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(400,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj]
Creating directory "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\lib\Release".
Creating directory "apriltag.dir\Release\apriltag.tlog".
InitializeBuildStatus:
Creating "apriltag.dir\Release\apriltag.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
Building Custom Rule C:/Users/superhhu/AppData/Local/Temp/pip-install-d2f0nww7/apriltag/core/CMakeLists.txt
CMake does not need to re-run because C:/Users/superhhu/AppData/Local/Temp/pip-install-d2f0nww7/apriltag/build/temp.win-amd64-3.6/Release/core/CMakeFiles/generate.stamp is up-to-date.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /I"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common" /I"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib" /I"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core." /nologo /Wall /WX- /O2 /Ob2 /D WIN32 /D _WINDOWS /D NDEBUG /D "CMAKE_INTDIR="Release"" /D apriltag_EXPORTS /D _WINDLL /D _MBCS /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"apriltag.dir\Release\" /Fd"apriltag.dir\Release\vc140.pdb" /Gd /TC /errorReport:queue -Wsign-compare -g -march=native -std=c99 "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\apriltag.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\apriltag_quad_thresh.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\tag16h5.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\tag25h7.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\tag25h9.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\tag36h10.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\tag36h11.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\tag36artoolkit.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\g2d.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\apriltag_family.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\zarray.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\zhash.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\zmaxheap.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\unionfind.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\matd.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\image_u8.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\pnm.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\image_f32.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\image_u32.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\workerpool.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\time_util.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\svd22.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\homography.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\string_util.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\getopt.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib\box.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib\contour.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib\lm.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib\pdfutil.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib\apriltag_quad_contour.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib\apriltag_vis.c"
4>cl : Command line error D8021: invalid numeric argument '/Wsign-compare' [C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj]
4>Done Building Project "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj" (default targets) -- FAILED.
1>Done Building Project "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ZERO_CHECK.vcxproj" (default target) (2) ->
(PrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(400,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ZERO_CHECK.vcxproj]
"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj" (default target) (4) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(400,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj]
"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj" (default target) (4) ->
(ClCompile target) ->
cl : Command line error D8021: invalid numeric argument '/Wsign-compare' [C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj]
2 Warning(s)
1 Error(s)
Time Elapsed 00:00:01.94
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\setup.py", line 74, in
py_modules=['apriltag']
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\site-packages\setuptools_init_.py", line 129, in setup
return distutils.core.setup(**attrs)
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\site-packages\wheel\bdist_wheel.py", line 179, in run
self.run_command('build')
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\setup.py", line 35, in run
self.build_extension(ext)
File "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\setup.py", line 60, in build_extension
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.
Failed building wheel for apriltag
Running setup.py clean for apriltag
Failed to build apriltag
Installing collected packages: apriltag
Running setup.py install for apriltag ... error
Complete output from command c:\users\superhhu\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;file='C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\superhhu\AppData\Local\Temp\pip-record-392a4m5q\install-record.txt --single-version-externally-managed --compile:
c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
copying python\apriltag.py -> build\lib.win-amd64-3.6
running build_ext
-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version to target Windows 10.0.17134.
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- 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 - not found
-- Found Threads: TRUE
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Checking for one of the modules 'opencv>=2.3;opencv-2.3.1;opencv-3.0.0'
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
PYTHON_EXECUTABLE
-- Build files have been written to: C:/Users/superhhu/AppData/Local/Temp/pip-install-d2f0nww7/apriltag/build/temp.win-amd64-3.6/Release
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 7/13/2018 8:48:32 AM.
1>Project "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" on node 1 (default targets).
1>Project "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" (1) is building "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
2>PrepareForBuild:
Creating directory "x64\Release\ZERO_CHECK\".
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(400,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ZERO_CHECK.vcxproj]
Creating directory "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\".
InitializeBuildStatus:
Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
Checking Build System
CMake does not need to re-run because C:/Users/superhhu/AppData/Local/Temp/pip-install-d2f0nww7/apriltag/build/temp.win-amd64-3.6/Release/CMakeFiles/generate.stamp is up-to-date.
CMake does not need to re-run because C:/Users/superhhu/AppData/Local/Temp/pip-install-d2f0nww7/apriltag/build/temp.win-amd64-3.6/Release/core/CMakeFiles/generate.stamp is up-to-date.
FinalizeBuildStatus:
Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
2>Done Building Project "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ZERO_CHECK.vcxproj" (default targets).
1>Project "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" (1) is building "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj" (3) on node 2 (default targets).
3>PrepareForBuild:
Creating directory "apriltag.dir\Release\".
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(400,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj]
Creating directory "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\lib\Release\".
Creating directory "apriltag.dir\Release\apriltag.tlog\".
InitializeBuildStatus:
Creating "apriltag.dir\Release\apriltag.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
Building Custom Rule C:/Users/superhhu/AppData/Local/Temp/pip-install-d2f0nww7/apriltag/core/CMakeLists.txt
CMake does not need to re-run because C:/Users/superhhu/AppData/Local/Temp/pip-install-d2f0nww7/apriltag/build/temp.win-amd64-3.6/Release/core/CMakeFiles/generate.stamp is up-to-date.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /I"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common" /I"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib" /I"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\." /nologo /Wall /WX- /O2 /Ob2 /D WIN32 /D _WINDOWS /D NDEBUG /D "CMAKE_INTDIR=\"Release\"" /D apriltag_EXPORTS /D _WINDLL /D _MBCS /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"apriltag.dir\Release\\" /Fd"apriltag.dir\Release\vc140.pdb" /Gd /TC /errorReport:queue -Wsign-compare -g -march=native -std=c99 "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\apriltag.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\apriltag_quad_thresh.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\tag16h5.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\tag25h7.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\tag25h9.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\tag36h10.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\tag36h11.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\tag36artoolkit.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\g2d.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\apriltag_family.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\zarray.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\zhash.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\zmaxheap.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\unionfind.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\matd.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\image_u8.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\pnm.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\image_f32.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\image_u32.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\workerpool.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\time_util.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\svd22.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\homography.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\string_util.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\common\getopt.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib\box.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib\contour.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib\lm.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib\pdfutil.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib\apriltag_quad_contour.c" "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\core\contrib\apriltag_vis.c"
3>cl : Command line error D8021: invalid numeric argument '/Wsign-compare' [C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj]
3>Done Building Project "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj" (default targets) -- FAILED.
1>Done Building Project "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ZERO_CHECK.vcxproj" (default target) (2) ->
(PrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(400,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ZERO_CHECK.vcxproj]
"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj" (default target) (3) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(400,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj]
"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj" (default target) (3) ->
(ClCompile target) ->
cl : Command line error D8021: invalid numeric argument '/Wsign-compare' [C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\build\temp.win-amd64-3.6\Release\core\apriltag.vcxproj]
2 Warning(s)
1 Error(s)
Time Elapsed 00:00:01.28
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\setup.py", line 74, in <module>
py_modules=['apriltag']
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\site-packages\setuptools\__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\setup.py", line 35, in run
self.build_extension(ext)
File "C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\setup.py", line 60, in build_extension
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
File "c:\users\superhhu\appdata\local\programs\python\python36\lib\subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.
----------------------------------------
Command "c:\users\superhhu\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;file='C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\superhhu\AppData\Local\Temp\pip-record-392a4m5q\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\superhhu\AppData\Local\Temp\pip-install-d2f0nww7\apriltag\
Hello,
If I want to pass along a wildcard value for IMAGE in camera calibration Python script, what will work? The following statement in the script (around line 55) does not work (and my Python ignorance is immediately apparent):
for filename in options.filenames:
Ideally, I could pass along a folder containing all the images. What is the best replacement for the above statement, please? Thanks.
Regards.
P.S.
The following snippet gets stuck "somewhere" after reading the first image file:
script_dir = os.path.dirname(__file__)
files = os.listdir(script_dir + "/calibrate") # options.filenames)
for filename in files: # options.filenames:
fqfn = script_dir + "/calibrate/"+ filename
print(f"Filename {fqfn}")
rgb = cv2.imread(fqfn)
The python code currently isn't python 3 compatible - I'm going to submit a pull request that fixes this.
I have successfully installed on mac m1 using arch -x86_64 virtualization (Rosetta) I can detect the tag from images provided in this repo. (after many headaches relating to compiling opencv in rosetta...)
I printed tagStandard41h12
for full body tracking as shown here:
https://github.com/ju1ce/April-Tag-VR-FullBody-Tracker/tree/master/images-to-print/trackers-a4-paper
I can detect them successfully via the iPhone app AprilTag3. but I'm trying to make a standalone solution in python and it seems this tag is not supported.
I have also tried copy-pasting the tag files from the official apriltag repo, but it seems it has a different struct apriltag_family definition (strangely it compiled without errors or warnings? but it crashes on segfault...)
I tried making necessary adjustments but for reasons that are unclear it keeps segfaulting only on this tag. I verified the lib works with all other preexisting tags.
note I have also tried compiling the original apriltag repo but it failed to load as some symbols are missing and/or different. either solution would work for me.
specifically, it crashes because it is missing (at least) apriltag_family_create
which I could not find in the original repo.
edit: looking again at the fullbody tracking repo I see files for another tag, tagCustom29h10
:
https://github.com/ju1ce/April-Tag-VR-FullBody-Tracker/blob/master/AprilTagTrackers/tagCustom29h10.cpp
(the app AprilTag3 does not support this tag but maybe it's noteworthy)
hi, I facing up with Segmentation fault (core dumped) while I am trying to run python script. I choose an image from hallway folder for detection in my code.
these are my codes below(modified from https://pypi.org/project/apriltag/):
import apriltag
import cv2
img = cv2.imread('/home/wwh/my_apriltag/apriltag/images/hallway/IMG_0612.jpg',cv2.IMREAD_GRAYSCALE)
detector = apriltag.Detector()
result = detector.detect(img)
print result
Hi @mzucker,
When I run your wrapper the code to print the pose matrix is inside the wrapper. Is there anyway that I can access the pose variable in other python scripts like demo.py
I want to plot the values that I am getting from the pose (x,y and z) to estimate the amount of error I am getting after calibrating the camera so that I can further develop a filter of some sort to rectify this error
Hi
I already install all requirements but when I want install in mac and windows get error ( already I had install the libary in another mac )
File "C:\Users\ASUS\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py", line 1234, in run_command
super().run_command(command)
File "C:\Users\ASUS\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\ASUS\AppData\Local\Temp\pip-install-fi_9roqm\apriltags_158cb604a2574af99a8b1356cb554008\setup.py", line 35, in run
self.build_extension(ext)
File "C:\Users\ASUS\AppData\Local\Temp\pip-install-fi_9roqm\apriltags_158cb604a2574af99a8b1356cb554008\setup.py", line 59, in build_extension
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
File "C:\Users\ASUS\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\Users\ASUS\AppData\Local\Temp\pip-install-fi_9roqm\apriltags_158cb604a2574af99a8b1356cb554008', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\ASUS\AppData\Local\Temp\pip-install-fi_9roqm\apriltags_158cb604a2574af99a8b1356cb554008\build\lib.win-amd64-cpython-39', '-DPYTHON_EXECUTABLE=C:\Users\ASUS\AppData\Local\Programs\Python\Python39\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\ASUS\AppData\Local\Temp\pip-install-fi_9roqm\apriltags_158cb604a2574af99a8b1356cb554008\build\lib.win-amd64-cpython-39', '-A', 'x64']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for apriltags
Running setup.py clean for apriltags
Failed to build apriltags
ERROR: Could not build wheels for apriltags, which is required to install pyproject.toml-based projects
I need to compute a Pose Matrix, which - I believe - is in the form M = Transl44 * Rot44 (and to know the measurement units for the Transl44); Your wrapper, afaik, gives a 3x3 homography; I am struggling (two days now) to reconstruct the PM without success. I am assuming that the PM (which can be easily decomposed if thought as Transl44*Rot44) expresses the position of the relevant tag in a camera-fixed coordinate system, correct? and I read that (a) when working with 4x4 matrices, Homog44 = CM44 * PM44 (CM = Camera Matrix) and (b) working with 3x3 we have Homog33 = CM34 * ReducedPM43 where the reduction of PM is obtained by deleting the third column (I am not sure how to manage the inversion of the latter formula and the reconstruction of CM44 from CM34 - if at all possible).
Somebody can help me please?
The story:
I am used to the results supplied by the program apriltags_demo as built according to http://people.csail.mit.edu/kaess/apriltags/.
Since now I need something that I can easily use in a Python program, I succesfully downloaded and run your Python wrapper (to this same library, I suppose?).
The apriltags_demo mentioned above gives results in terms of x,y,z (in meters) and yaw,pitch,roll (in radians), which I should be able to convert to a Pose matrix if it was clear which the reference systems and units are used. I have tried guess something about the ref sys and units used and have written a matlab program which tries to implement the HM <=> PM/CM conversion in order to compare the results of apriltags_demo with the results of the Python wrapper (using as input the main picture from the website https://april.eecs.umich.edu/software/apriltag/; the same six small tags are detected by both the programs, the big one is not(!)).
Sorry for the long text, but I am trying to be as clear as I can because I believe that clear answers can be given only to clear questions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.