Code Monkey home page Code Monkey logo

python-aruco's Introduction

python-aruco

SWIG generated Python wrappers for ArUco library. Works with OpenCV Python module cv2 resp. numpy array data types.

Tested on Linux Mint 19 x86_64, OpenCV 4.1.0, ArUco 3.1.12 Python 3.6.9 and NumPy 1.18.0

Installation via pip

  1. Install / compile OpenCV with Python3 support
  2. Install / compile ArUco 3.1.12
  3. run pip3 install aruco

Build Python3 module via CMake

  1. Install / compile OpenCV with Python2 support
  2. Install / compile ArUco 3.1.12
  3. Install swig3: sudo apt-get install swig3.0 for Debian/Ubuntu like systems. On 14.04 and other older systems you will need to go to "Software Sources" and check backports in the Updates tab, and reload before installing.
  4. Install NumPy pip3 install numpy (maybe you already need it for OpenCV Python support) or install via system package manager.
  5. Build the Python wrapper:
    • Create a new directory build in this project: mkdir build && cd build
    • Run CMake to configure the project: cmake ..
    • Run make to build the wrappers: make
  6. The built package is now located in python/dist/, you can install it via pip: pip3 install python/dist/*.whl

Test

example video

open a prompt in example/ and run: python3 ./example.py

fractal marker example

open a prompt in example/ and run: python3 ./fractal.py

If the Python doesn't find some shared objects, add the library location to LD_LIBRARY_PATH: export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH

Problems

I just tested some basic functions with example/example.py / example/fractal.py. Please report errors and problems.

  • Some return value templates like std::vector<Point3f> don't work yet (e.g. for marker.get3DPoints())

Thanks

python-aruco's People

Contributors

byteofsoren avatar fehlfarbe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-aruco's Issues

Numpy fatal error

Hello fehlfarbe,
I am very interested in this wrapper, but I can't generate aruco.py.
When I run ./swigbuild.sh shows the following error:

...
building '_aruco' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-lMBuS3/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/include/opencv2 -I/usr/include/eigen3/ -I. -I/usr/include/python2.7 -c aruco_wrap.cxx -o build/temp.linux-x86_64-2.7/aruco_wrap.o -std=c++11 -Wall -fopenmp
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
aruco_wrap.cxx:5283:31: fatal error: numpy/arrayobject.h: No such file or directory
 #include <numpy/arrayobject.h>
                               ^
compilation terminated.

I have OpenCV 3.2.0, ArUco 2.0.19, Python 2.7.12 and NumPy 1.10.4 on Ubuntu 16.10.

Thanks for your help.

issue about opencv/core.hpp

hi, @fehlfarbe ,this time I am trying to install python-aruco 1.3.0in the docker .and i just checked that we can export the path to CFLAGS to solve the issue of numpy/arraynp.hpp issue so can we just solve the two issue in the same way as i find the opencv include path .can you share some suggestions if i want to build it in the docker image(anaconda python as default)
https://github.com/fehlfarbe/python-aruco/issues/5as this one does?
i solved the issue as per the instruction in this link for numpy, but can not solve the opencv issue:
image
image
image
image
image
still issues even after modified the CFLAGS.

Encountered error while trying to install package. I Windows 11

error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

Encountered error while trying to install package.

ld: file not found: @rpath/libquadmath.0.dylib for architecture arm64 on MacBook Air M1

Hi!
I get an error ld: file not found: @rpath/libquadmath.0.dylib for architecture arm64 on MacBook Air M1 when do the make command to build the Python wrapper for aruco library.

I find libquadmath.0.dylib at two location:

  • /opt/homebrew/Cellar/gcc/12.2.0/lib/gcc/current/libquadmath.0.dylib
  • /opt/homebrew/Cellar/gcc/12.2.0/lib/gcc/12/libquadmath.0.dylib

When I check for arch shows arm64 as need.
lipo /opt/homebrew/Cellar/gcc/12.2.0/lib/gcc/current/libquadmath.0.dylib -archs
lipo /opt/homebrew/Cellar/gcc/12.2.0/lib/gcc/12/libquadmath.0.dylib -archs

What I'm doing wrong?

Does not work on python 3.7, 3.6 in Ubuntu

The ArUco library is not compiling on Ubuntu 18.04. 20.04 through WSL2.
Tried all possible methods, using Cmake and through pip etc.

Used specified version of opencv and numpy.

Please let me know, if any methods or library versions that your working on.

image

Error with CvDrawingUtils.draw3dAxis

In the example.py, I add:
aruco.CvDrawingUtils.draw3dAxis(frame, marker, camparam)
but with error:

NotImplementedError: Wrong number or type of arguments for overloaded function 'CvDrawingUtils_draw3dAxis'.
swig/python detected a memory leak of type 'aruco::MarkerDetector::Params *', no destructor found.

Does the funtion draw3dAxis work?

Thanks

Get the extrinsics for each marker

Hello,

I was wondering if you could share a bit of code on how to get the extrinsics of the marker, because I need the camera to marker transform.

I went through the example.py but there is no such information. Also tried to get it using the calculateExtrinsics function but I can't seem to call it right (complains about the number of arguments / types).

Could you share an example?

Thanks in advance,

Miguel

numpy/arrayobject.h error

 ./python3.7m -m pip install aruco --user
Collecting aruco
  Using cached https://files.pythonhosted.org/packages/ab/e0/ed8d9d366a9816ba34908ca91d88149a7b3dcc61f91c76850269639965a0/aruco-3.1.2.0.tar.gz
Requirement already satisfied: numpy in /home/user/.local/lib/python3.7/site-packages (from aruco) (1.17.4)
Requirement already satisfied: opencv-contrib-python in /home/user/.local/lib/python3.7/site-packages (from aruco) (4.1.2.30)
Installing collected packages: aruco
    Running setup.py install for aruco ... error
    ERROR: Command errored out with exit status 1:
     command: /home/user/src/blender-2.81-linux-glibc217-x86_64/2.81/python/bin/python3.7m -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cxyyakvl/aruco/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cxyyakvl/aruco/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-yhtdq3m3/install-record.txt --single-version-externally-managed --compile --user --prefix=
         cwd: /tmp/pip-install-cxyyakvl/aruco/
    Complete output (16 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    copying aruco.py -> build/lib.linux-x86_64-3.7
    running build_ext
    building '_aruco' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/src
    creating build/temp.linux-x86_64-3.7/src/aruco
    creating build/temp.linux-x86_64-3.7/src/aruco/fractallabelers
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/home/sergey/Developer/build_linux/deps/Release/sqlite/include -I/home/sergey/Developer/build_linux/deps/Release/bzip2/include -I/home/sergey/Developer/build_linux/deps/Release/lzma/include -I/home/sergey/Developer/build_linux/deps/Release/zlib/include -fPIC -fPIC -I/usr/local/include/opencv4/ -I/usr/local/include/opencv2 -I/usr/include/eigen3/ -Isrc/ -I/home/user/src/blender-2.81-linux-glibc217-x86_64/2.81/python/include/python3.7m -c aruco_wrap.cxx -o build/temp.linux-x86_64-3.7/aruco_wrap.o -std=c++11 -Wall -O3 -g0 -DNDEBUG -fopenmp
    aruco_wrap.cxx:5481:31: fatal error: numpy/arrayobject.h: No existe el archivo o el directorio
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/src/blender-2.81-linux-glibc217-x86_64/2.81/python/bin/python3.7m -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cxyyakvl/aruco/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cxyyakvl/aruco/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-yhtdq3m3/install-record.txt --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.

can this be of a bug???

python
'''

import aruco
Traceback (most recent call last):
File "", line 1, in
File "/opt/conda/lib/python3.6/site-packages/aruco.py", line 28, in
_aruco = swig_import_helper()
File "/opt/conda/lib/python3.6/site-packages/aruco.py", line 24, in swig_import_helper
_mod = imp.load_module('_aruco', fp, pathname, description)
File "/opt/conda/lib/python3.6/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/opt/conda/lib/python3.6/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: /opt/conda/lib/python3.6/site-packages/_aruco.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZTVN5aruco15DictionaryBasedE
'''

I have successfully installed the python-aruco1.3.0 and nothing with error but just with some warning .
when I import it in python I got this error .BTW ,my default python is in anaconda. anyone have the idea of this import error? what should i do???

issue about swigbuild.sh:fatal error: opencv2/core.hpp

@fehlfarbe , sorry yesterday i just installed the wrong python-aruco. what i need is the 1.0.3 version,so i just uninstall all the opencv and aruco with the command : 1.for opencv:
make uninstall
cd ..
sudo rm -r build
sudo rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*
2.for aruco : sudo make uninstall (in build)
and then i just reinstall the opencv2.10 with the Install-Opencv ,and reinstall the aruco1.0.3
and all of them is fine but when i run the swigbuild.sh i get the error like this:
2018-01-18 22 44 57
can you share some suggestions? do i need reinstall the opencv ?many thanks.

Segmentation Fault when importing aruco with python3 - FaultHandler included

rory@rory-MS-7850:/$ sudo -H pip3 install aruco
[sudo] password for rory:
Collecting aruco
Using cached https://files.pythonhosted.org/packages/ab/e0/ed8d9d366a9816ba34908ca91d88149a7b3dcc61f91c76850269639965a0/aruco-3.1.2.0.tar.gz
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from aruco)
Requirement already satisfied: opencv-contrib-python in /usr/local/lib/python3.6/dist-packages (from aruco)
Building wheels for collected packages: aruco
Running setup.py bdist_wheel for aruco ... done
Stored in directory: /root/.cache/pip/wheels/29/8e/14/c9a9515da82339e360073639926a54c32adea4d62cff649196
Successfully built aruco
Installing collected packages: aruco
Successfully installed aruco-3.1.2.0
rory@rory-MS-7850:/$ python3
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import aruco
Segmentation fault
rory@rory-MS-7850:/$ python3
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
import faulthandler
faulthandler.enable()
import aruco
Fatal Python error: Segmentation fault

Current thread 0x00007fd8f6007740 (most recent call first):
File "/usr/lib/python3/dist-packages/apt/init.py", line 34 in
File "", line 219 in _call_with_frames_removed
File "", line 678 in exec_module
File "", line 665 in _load_unlocked
File "", line 955 in _find_and_load_unlocked
File "", line 971 in _find_and_load
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24 in
File "", line 219 in _call_with_frames_removed
File "", line 678 in exec_module
File "", line 665 in _load_unlocked
File "", line 955 in _find_and_load_unlocked
File "", line 971 in _find_and_load
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23 in
File "", line 219 in _call_with_frames_removed
File "", line 678 in exec_module
File "", line 665 in _load_unlocked
File "", line 955 in _find_and_load_unlocked
File "", line 971 in _find_and_load
File "/usr/lib/python3/dist-packages/apport/report.py", line 30 in
File "", line 219 in _call_with_frames_removed
File "", line 678 in exec_module
File "", line 665 in _load_unlocked
File "", line 955 in _find_and_load_unlocked
File "", line 971 in _find_and_load
File "/usr/lib/python3/dist-packages/apport/init.py", line 5 in
File "", line 219 in _call_with_frames_removed
File "", line 678 in exec_module
File "", line 665 in _load_unlocked
File "", line 955 in _find_and_load_unlocked
File "", line 971 in _find_and_load
File "", line 219 in _call_with_frames_removed
File "", line 941 in _find_and_load_unlocked
File "", line 971 in _find_and_load
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63 in apport_excepthook
Segmentation fault
rory@rory-MS-7850:/$

Installation on Windows

Hello,
I am trying to install the aruco wrapper on Windows. I have seen previous issues on this topic. Has anyone successfully been able to make it work ?
Thanks a lot

Regards

pip install fails

Can't get the pip install to work.

Collecting aruco
  Using cached https://files.pythonhosted.org/packages/ca/32/07ec0148fade2615e144b834aca177d201564197795e1639ce1850a766b6/aruco-3.0.4.1.tar.gz
Requirement already satisfied: numpy in /usr/local/lib/python3.7/site-packages (from aruco) (1.15.0)
Building wheels for collected packages: aruco
  Building wheel for aruco (setup.py) ... error
  Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-66x7rmjq/aruco/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 /private/tmp/pip-wheel-bs8zjq57 --python-tag cp37:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14-x86_64-3.7
  copying aruco.py -> build/lib.macosx-10.14-x86_64-3.7
  running build_ext
  building '_aruco' extension
  creating build/temp.macosx-10.14-x86_64-3.7
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include/opencv2 -I/usr/include/eigen3/ -Isrc/include/ -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c aruco_wrap.cxx -o build/temp.macosx-10.14-x86_64-3.7/aruco_wrap.o -std=c++11 -Wall -fopenmp -Wunused-variable
  clang: error: unsupported option '-fopenmp'
  error: command 'clang' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for aruco
  Running setup.py clean for aruco
Failed to build aruco
Installing collected packages: aruco
  Running setup.py install for aruco ... error
    Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-66x7rmjq/aruco/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-hu9jy8_x/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-x86_64-3.7
    copying aruco.py -> build/lib.macosx-10.14-x86_64-3.7
    running build_ext
    building '_aruco' extension
    creating build/temp.macosx-10.14-x86_64-3.7
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include/opencv2 -I/usr/include/eigen3/ -Isrc/include/ -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c aruco_wrap.cxx -o build/temp.macosx-10.14-x86_64-3.7/aruco_wrap.o -std=c++11 -Wall -fopenmp -Wunused-variable
    clang: error: unsupported option '-fopenmp'
    error: command 'clang' failed with exit status 1
    
    ----------------------------------------
Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-66x7rmjq/aruco/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-hu9jy8_x/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-66x7rmjq/aruco/```

Install Problem

I've followed the instructions (on https://github.com/fehlfarbe/python-aruco) on an Ubuntu 14.0.4 laptop.
I used opencv-2.4.10 which may be old, but opencv.org is offline and it's what I downloaded previously.
When I try to run the example script I get:
Traceback (most recent call last):
File "example.py", line 14, in
boardconfig = aruco.BoardConfiguration("chessboardinfo_small_meters.yml")
AttributeError: 'module' object has no attribute 'BoardConfiguration'

Any ideas?

Looking at modules in python I see:
ls -l /usr/local/lib/python 2.7/dist-packages/aruco
-rw-r--r-- 1 root staff 248 lis 5 01:03 /usr/local/lib/python2.7/dist-packages/aruco-0.1.egg-info
-rw-r--r-- 1 root staff 27378 lis 5 00:57 /usr/local/lib/python2.7/dist-packages/aruco.py
-rw-r--r-- 1 root staff 49286 lis 5 01:03 /usr/local/lib/python2.7/dist-packages/aruco.pyc
-rwxr-xr-x 1 root staff 5434075 lis 5 01:03 /usr/local/lib/python2.7/dist-packages/_aruco.so
-rwxrwxr-x 1 root staff 2968922 sty 7 2016 /usr/local/lib/python2.7/dist-packages/aruco.so

lis 5 is 5th November but sty 7 is 7th January, which looks suspicious. I've tried removing that but it makes no difference.
What should I try?
Yours
Ian

Creation of Fractal markers using aruco 3.1.12

Hello all,

I had a question and I would be thankful if you could guide me through it. Is it possible to create a fractal marker using this aruco package?

I was wondering that in a way when we use import cv2.aruco and then obtain predefined dictionaries for aruco eg. dict_5x5_50 or dict_6x6_50, etc. Is it possible to do the same with the newly installed aruco 3.1.12 library along with this package?

Thanks in advance. :)

Fractal marker example

Hello,

I was trying to understand and execute the fractal.py code. However, I got an error stating No module named 'aruco'. Also, I would like to ask that the function 'aruco.FractalDetector()' in fractal.py is included in aruco package? Can you please help me out with the steps that I need to take in order to install aruco?

Thank you in advance. :)

2D distance camera to fractal marker on x-y plane

Hi,

It's good to see 3.1.12 is master and easy to install via pip :)
Thank you.

I will use fractal marker to make land a multicopter.

.getCenter method returns center of marker like kind of pixel map.
on the other hand rvec and tvec are includes radian values except tvec[2][0] (z-axis)
Is there any method (in library) to get distance between camera and fractal marker on 2D.(x, y)

installation troubles

The following error when running the example:

pi@raspberrypi:~/aruco/example $ sudo python example.py Traceback (most recent call last): File "example.py", line 9, in <module> import aruco File "/usr/local/lib/python2.7/dist-packages/aruco.py", line 28, in <module> _aruco = swig_import_helper() File "/usr/local/lib/python2.7/dist-packages/aruco.py", line 24, in swig_import_helper _mod = imp.load_module('_aruco', fp, pathname, description) ImportError: libaruco.so.2.0: cannot open shared object file: No such file or directory

I am using a raspberry pi 3, and set up opencv and numpy as the PiImageSearch tutorial.

I compiled and installed ArUco 2.0.19. If this needs to change, could you let me know how to do that, because when I try to install 1.3.0 I get an error probably because the other version is still installed.

Anyway thanks for your help

Python3 install errors

Several 'was not declared in this scope errors'.
CV_RETR_LIST, CV_CHAIN_APPROX_NONE, CV_BGR2GRAY, cvSize, CV_TERMCRIT_ITER, CV_TERMCRIT_EPS, cvTermCriteria, cvScalar.

I did get this to install properly (with difficultly) for Python 3 on my previous system: Ubuntu 18. However, it does not work in Manjaro, which is Arch based. I am not sure of the exact reason. Lastly, the pip module aruco also does not work with pip3.

making a pip installation available

I am struggling for days now to make aruco be a importable library into my own code.
With your knowledge of python would it not be possible to make a pip-installable version of this library? It would have made my life much easier having that available - in none of the environments I so far tried the aruco is a known library. I am working on W10/64

FractalDetector getConfiguration method

hi again,

          detector = aruco.FractalDetector()
          detector.getConfiguration()

returns

          <Swig Object of type 'FractalMarkerSet *' at 0x7fee5b4d2f90>
          swig/python detected a memory leak of type 'FractalMarkerSet *', no destructor found.

swigbuild.sh error

I am have compiled and installed aruco 3.1.0, python 2.7.5 and opencv 3.4.5

My swigbuild.sh fails with
aruco_wrap.cxx:5472:11: fatal error: aruco/markerlabelers/dictionary_based.h: No such file or directory #include <aruco/markerlabelers/dictionary_based.h>

but the file is there:
# find . | grep -i dictionary_based.h ./aruco-3.1.0/src/dictionary_based.h ./python-aruco/src/include/aruco/markerlabelers/dictionary_based.h

Could it be an include folder issue ?

Kind regards,
Morgan

Aruco py

Hi,
when launching the ./swigbuild.sh python3 I see this:
pi@raspberrypi:~/python-aruco $ ./swigbuild.sh python3
./swigbuild.sh: riga 26: swig: comando non trovato
./swigbuild.sh: riga 27: swig: comando non trovato
Traceback (most recent call last):
File "setup.py", line 14, in
shutil.copy("./py3/aruco.py", ".")
File "/usr/lib/python3.7/shutil.py", line 245, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.7/shutil.py", line 120, in copyfile
with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: './py3/aruco.py'

Please help thank you

swigbuild.sh fails

Hello,

Trying to install this. When I type ./swigbuild.sh I get:

rm: cannot remove 'aruco.py': No such file or directory
...

Hunk #1 FAILED at 35
.....

all the hunks fail

aruco.i:53: Error: Unable to find 'aruco/exports.h'
aruco.i:57: Error: Unable to find 'aruco/checkrectcontour.h'
aruco.i:62: Error: Unable to find 'aruco/levmarq.h'

MarkerDetector arguments

I try to detect a single marker. I created markerdetector = aruco.MarkerDetector() and try to detect with marker = markerdetector.detect(frame, camaraparam, 200) but this gives me the error message:
if marker.isValid(): AttributeError: 'tuple' object has no attribute 'isValid'"

If I run markerdetector.detect(frame, marker, camparam), I get the following error message
File "/usr/lib/python3.5/site-packages/aruco.py", line 679, in detect return _aruco.MarkerDetector_detect(self, *args) NotImplementedError: Wrong number or type of arguments for overloaded function 'MarkerDetector_detect'.

How do I have to use markerdetector the right was? Is there a problem with the parameters in the python wrapper?

Thank you in advance.

Cheers, Andreas

pip install still not working with python3

it still pussly me when going from one machine to another as pip install arcuo does not work with python aruco.
It's quite some time since python 2 support ended completely.

Any plans to make that work ?

Undeclared identifier

Hello,

It looks like I'm getting a bunch of undeclared identifers and would love some help resolving the issues. I've attached the logfile below.
logfile.txt

how to install aruco

install aruco error:

(tensorflow) jackstan@Jackstan-All-Series:~$ sudo -H pip install aruco
Requirement already satisfied: aruco in /usr/local/lib/python3.5/dist-packages (3.1.2.0)
Requirement already satisfied: numpy in /usr/local/lib/python3.5/dist-packages (from aruco) (1.16.4)
Requirement already satisfied: opencv-contrib-python in /usr/local/lib/python3.5/dist-packages (from aruco) (4.1.0.25)

(tensorflow) jackstan@Jackstan-All-Series:~$ python
Python 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import aruco
detector = aruco.MarkerDetector()
Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'aruco' has no attribute 'MarkerDetector'

cannot find -lacuro

Hi, I am trying to install acuro on my RasPi3 and after installing everything I've encountered a problem saying; /usr/bin/ld: cannot find -laruco collect2: error: ld returned 1 exit status error: command 'arm-linux-gnueabihf-g++' failed with exit status 1
while performing the $ ./swigbuild.sh python3. I have tried installing both acuro 3.x and 2.x and the error was always the same. Do you have any idea what could be causing this?

issue about installation

I do followed the instruction and no matter in python2.7 or python3.4 I still get the same error ,by the way I am using ubuntu14.04 .can anyone help with ?

#warning "Using deprecated NumPy API, disable it by "
^
In file included from /usr/include/python2.7/numpy/ndarrayobject.h:26:0,
from /usr/include/python2.7/numpy/arrayobject.h:4,
from aruco_wrap.cxx:5292:
/usr/include/python2.7/numpy/__multiarray_api.h:1574:0: warning: "PyArray_SetBaseObject" redefined [enabled by default]
#define PyArray_SetBaseObject
^
aruco_wrap.cxx:5284:0: note: this is the location of the previous definition
#define PyArray_SetBaseObject(arr, x) (PyArray_BASE(arr) = (x))
^
In file included from aruco_wrap.cxx:5304:0:
src/include/aruco/levmarq.h:31:22: fatal error: Eigen/Core: 没有那个文件或目录
#include <Eigen/Core>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-EY0OU_/aruco/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-F6Q9sM-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-EY0OU_/aruco/

ImportError: libopencv_core.so.3.4: cannot open shared object file: No such file or directory

@fehlfarbe i installed everything successfully with no warning and bug but even through i have done : export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
i still get this error .can you help me out ,please.

Python 3.4.3 (default, Nov 28 2017, 16:41:13)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.

import aruco
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.4/dist-packages/aruco.py", line 28, in
_aruco = swig_import_helper()
File "/usr/local/lib/python3.4/dist-packages/aruco.py", line 24, in swig_import_helper
_mod = imp.load_module('_aruco', fp, pathname, description)
File "/usr/lib/python3.4/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
ImportError: libopencv_core.so.3.4: cannot open shared object file: No such file or directory

python-aruco 1.3.0 opencv3.4.0 numpy 1.9.0
the way i install opencv is : (python3.4 as default)
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D PYTHON_EXECUTABLE=$(which python3) ..
any information should i provide please ask, thanks

ImportError: libaruco.so.3.0: cannot open shared object file: No such file or directory

I am running an Ubuntu 16.04 machine with python 3.6.4, Anaconda 5.0.1. A virtual environment named py36 was created with Anaconda for my project. I have completed the installation following the Installation Python3 (experimental). In order to accommodate the system environment, setup.py was edited as follows:

from distutils.core import setup, Extension
sourcefiles = ['aruco_wrap.cxx']
aruco_module = Extension('_aruco',
sources=sourcefiles,
language="c++",
extra_compile_args=["-std=c++11", "-Wall", "-fopenmp", "-Wunused-variable"],
include_dirs=["/usr/local/include/opencv2", "/home/*/anaconda3/envs/py36/include/eigen3", "."],
libraries=["opencv_core", "opencv_imgproc", "opencv_calib3d", "opencv_highgui", "aruco"],
library_dirs=["/usr/local/lib","/home/*/programs/aruco304/install/lib","/home/*/anaconda3/envs/py36/lib"])

setup(name='aruco', version='3.0', author="""ArUco: Rafael Muñoz Salinas, Python wrappers: Marcus Degenkolbe""", description="""ArUco Python wrappers""", ext_modules=[aruco_module], py_modules=["aruco"], )

After the installation, the corresponding .so and .py files (titled as _aruco.cpython-36m-x86_64-linux-gnu.so and aruco.py) were generated in the path--/home/*/anaconda3/envs/py36/lib/python3.6/site-packages. When the program was acitvated, an issue appeared:
ImportError: libaruco.so.3.0: cannot open shared object file: No such file or directory

In fact, no file named as libaruco.so.3.0 was generated during the installation. I tried to make a link file by ln -s path/to/virtual/environment/_aruco.cpython-36m-x86_64-linux-gnu.so path/to/virtual/environment/libaruco.so.3.0. But it didn't work.

Draw Markers

Is it possible to use the drawMarker function to create ArUco markers with this wrapper?
If not, its ok, but how should I go about creating markers?
Thanks

How to set camera parameters not from a file

Hello,

To set the camera parameters in your example.py you do

camparam = aruco.CameraParameters()
camparam.readFromXMLFile("dfk72_6mm_param2.yml")

I was trying to set the camera parameters, i.e., image size, distorsion and intrinsics not as in the example but using some function. I searched and found the function setParams from the class CameraParameters (line 124 of aruco.py).

The problem was I tried to use that function in several ways but could never get it to work.

Could you give me an example of how to set the camera parameters directly from the code?

Thanks in advance,

Miguel

BTW, I am sorry because I am a bit of a newbie with these python bindings. Perhaps there is an easy solution.

Issue when cross-compiling to arm

For cross-compiling I adjusted the include directories in setup.py and could build everything.
On import aruco I get the following error though:

>>> import aruco
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/aruco.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 985, in _gcd_import
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 577, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 938, in create_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: /usr/lib/python3.5/site-packages/_aruco.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: _ZN2cv19FastFeatureDetector6createEibi

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/site-packages/aruco.py", line 17, in <module>
    _aruco = swig_import_helper()
  File "/usr/lib/python3.5/site-packages/aruco.py", line 16, in swig_import_helper
    return importlib.import_module('_aruco')
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: /usr/lib/python3.5/site-packages/_aruco.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: _ZN2cv19FastFeatureDetector6createEibi

Does anyone have a pointer on what went wrong here?

ArUco 2.0.19 issue

Hey fehlfarbe,
I just got a fresh install of everything, to test the recent changes you made.
I chose ArUco 2.0.19, python2, and opencv 3.1.0,
however upon running swigbuild.sh, the following error:

In file included from aruco_wrap.cxx:5209:0:
./aruco/levmarq.h:3:22: fatal error: Eigen/Core: No such file or directory
 #include <Eigen/Core>
                      ^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

dlopen fails when importing aruco

Dear all,
I tried to compile aruco and the python wrapper, but the latest one is failing on something.
Specifically, this is what I get when I try to import aruco

import aruco
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "aruco.py", line 17, in <module>
    _aruco = swig_import_helper()
  File "aruco.py", line 16, in swig_import_helper
    return importlib.import_module('_aruco')
  File "/Users/tuttoweb/miniconda2/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: dlopen(./_aruco.so, 2): Symbol not found: __ZN5aruco9MarkerMap15convertToMetersEf
  Referenced from: ./_aruco.so
  Expected in: flat namespace
 in ./_aruco.so

I googled it without success.
I am using python 2 on MacOS X High Sierra. I found that might be caused by recent versions of bumpy (I downgraded to 1.10 without success).

Do you have any knowledge how to debug this?

How does it Determine the Board Type?

In your example (example.py), how does the example know which type of board to look for?
Could you point me to references for looking at how to create/specify a board parameters file or something of the sort?

Error while installation

While running swigbuild.sh script in Ubuntu terminal, I am getting an error

aruco_wrap.cxx:5227:31: fatal error: numpy/arrayobject.h: No such file or directory
#include <numpy/arrayobject.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Any idea what's happening? I am installing this in a virtual environment with numpy installed in it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.