Open sanjaysswami opened 5 years ago
Can you provide your environment? and use pip list to list your packages... I am trying to reproduce the problem...
I have similar problem:
python3 MarkerPrinter.py --aruco --file "./aruco.pdf" --dictionary DICT_ARUCO_ORIGINAL --marker_length 0.07 --marker_id 0 Save ArUco marker with parms: {'fileName': './aruco.pdf', 'dictionary': 'DICT_ARUCO_ORIGINAL', 'markerLength': 0.07, 'markerID': 0, 'borderBits': 1, 'pageBorderX': 0.0, 'pageBorderY': 0.0} Traceback (most recent call last): File "MarkerPrinter.py", line 1201, in <module> MarkerPrinter.GenArucoMarkerImage(args.fileName, args.dictionary, markerID, markerLength, borderBits=borderBits, pageBorder = (pageBorderX, pageBorderY)) File "MarkerPrinter.py", line 543, in GenArucoMarkerImage markerLength + pageBorder[1] * 2) as surface: AttributeError: __enter__
pip3 list Package Version
apparmor 2.12.2
appdirs 1.4.3
cairocffi 1.1.0
CairoSVG 2.4.2
catkin 0.7.18
catkin-pkg 0.4.13
cffi 1.13.2
Click 7.0
cmdln 2.0.0
configobj 5.0.6
cssselect2 0.2.2
cupshelpers 1.0
cycler 0.10.0
decorator 4.2.1
defusedxml 0.6.0
docutils 0.15.2
empy 3.3.4
gencpp 0.6.2
geneus 2.2.6
genlisp 0.4.17
genmsg 0.5.12
gennodejs 2.0.1
genpy 0.6.8
GPUtil 1.4.0
ifaddr 0.1.6
imutils 0.5.3
isc 2.0
kiwisolver 1.1.0
LibAppArmor 2.12.2
matplotlib 3.1.1
meld 3.18.0
nose 1.3.7
numpy 1.17.1
olefile 0.46
opencv-python 4.1.1.26
packaging 16.8
Pillow 6.2.1
pip 19.2.2
ply 3.10
py-cpuinfo 5.0.0
pycairo 1.15.1
pycparser 2.19
pycups 1.9.73
pycurl 7.43.0.2
Pygments 2.4.2
pygobject 3.26.1
pyparsing 2.2.0
PyQt5 5.13.1
pysmbc 1.0.16
python-dateutil 2.8.0
python-linux-procfs 0.6
python-nmap 0.6.1
pyudev 0.21.0
PyYAML 5.1.2
rakali 0.0.11
reportlab 3.5.23
roman 3.2
rpm 4.14.1
scipy 1.3.1
setuptools 40.5.0
sip 4.19.19
six 1.11.0
slip 0.6.5
slip.dbus 0.6.5
tinycss2 1.0.2
tk 0.1.0
urlscan 0.9.2
urwid 2.0.1
webencodings 0.5.1
xcffib 0.8.1
zeroconf 0.23.0
This is on opensuse linux, with latest opencv from git.
I have similar problem:
python3 MarkerPrinter.py --aruco --file "./aruco.pdf" --dictionary DICT_ARUCO_ORIGINAL --marker_length 0.07 --marker_id 0 Save ArUco marker with parms: {'fileName': './aruco.pdf', 'dictionary': 'DICT_ARUCO_ORIGINAL', 'markerLength': 0.07, 'markerID': 0, 'borderBits': 1, 'pageBorderX': 0.0, 'pageBorderY': 0.0} Traceback (most recent call last): File "MarkerPrinter.py", line 1201, in <module> MarkerPrinter.GenArucoMarkerImage(args.fileName, args.dictionary, markerID, markerLength, borderBits=borderBits, pageBorder = (pageBorderX, pageBorderY)) File "MarkerPrinter.py", line 543, in GenArucoMarkerImage markerLength + pageBorder[1] * 2) as surface: AttributeError: __enter__
pip3 list Package Version
apparmor 2.12.2 appdirs 1.4.3 cairocffi 1.1.0 CairoSVG 2.4.2 catkin 0.7.18 catkin-pkg 0.4.13 cffi 1.13.2 Click 7.0 cmdln 2.0.0 configobj 5.0.6 cssselect2 0.2.2 cupshelpers 1.0 cycler 0.10.0 decorator 4.2.1 defusedxml 0.6.0 docutils 0.15.2 empy 3.3.4 gencpp 0.6.2 geneus 2.2.6 genlisp 0.4.17 genmsg 0.5.12 gennodejs 2.0.1 genpy 0.6.8 GPUtil 1.4.0 ifaddr 0.1.6 imutils 0.5.3 isc 2.0 kiwisolver 1.1.0 LibAppArmor 2.12.2 matplotlib 3.1.1 meld 3.18.0 nose 1.3.7 numpy 1.17.1 olefile 0.46 opencv-python 4.1.1.26 packaging 16.8 Pillow 6.2.1 pip 19.2.2 ply 3.10 py-cpuinfo 5.0.0 pycairo 1.15.1 pycparser 2.19 pycups 1.9.73 pycurl 7.43.0.2 Pygments 2.4.2 pygobject 3.26.1 pyparsing 2.2.0 PyQt5 5.13.1 pysmbc 1.0.16 python-dateutil 2.8.0 python-linux-procfs 0.6 python-nmap 0.6.1 pyudev 0.21.0 PyYAML 5.1.2 rakali 0.0.11 reportlab 3.5.23 roman 3.2 rpm 4.14.1 scipy 1.3.1 setuptools 40.5.0 sip 4.19.19 six 1.11.0 slip 0.6.5 slip.dbus 0.6.5 tinycss2 1.0.2 tk 0.1.0 urlscan 0.9.2 urwid 2.0.1 webencodings 0.5.1 xcffib 0.8.1 zeroconf 0.23.0
This is on opensuse linux, with latest opencv from git.
It seems old pycairo surface do not support enter attribute, that mean it do not support with as statement. I will try your pycairo version, my pycairo version is 1.18.1
Thanks for the hint, it works with newer pycairo version. Would it be possible to split single markers into multiple DIN-A4 pages? So that you could cut and paste the papers? Possibly splitting at the bins of the marker?
Thanks for the hint, it works with newer pycairo version. Would it be possible to split single markers into multiple DIN-A4 pages? So that you could cut and paste the papers? Possibly splitting at the bins of the marker?
Already done, you can read readme😀, Both gui and command interface indeed provide parameter to do that.
If you are using consumer level printer,
you will suffer from not able printing too large marker,
so just set chunks shape at the GUI subSize entry before saving the marker to files,
it will divide output marker to chunks.
If you are using command-line interface,
just add --sub_size_x x --sub_size_y y as parameters.
No, I mean to split a single aruco marker (no board). This would be to print large single markers, which need to be recognized over great distances.
pip3 install pycairo --upgrade
This will resolve this issue
@dogod621 I tried to run your code but I am getting the following error. Can you please help me with this?
~/sanjay_ws/src/aruco_generator/OpenCVMarkerPrinter$ python MarkerPrinter.py --aruco --file "./aruco.pdf" --dictionary DICT_ARUCO_ORIGINAL --marker_length 0.07 --marker_id 0 --border_bits 1 Save ArUco marker with parms: {'pageBorderX': 0.0, 'borderBits': 1, 'markerID': 0, 'pageBorderY': 0.0, 'fileName': './aruco.pdf', 'markerLength': 0.07, 'dictionary': 'DICT_ARUCO_ORIGINAL'} Traceback (most recent call last): File "MarkerPrinter.py", line 1193, in
MarkerPrinter.GenArucoMarkerImage(args.fileName, args.dictionary, markerID, markerLength, borderBits=borderBits, pageBorder = (pageBorderX, pageBorderY))
File "MarkerPrinter.py", line 535, in GenArucoMarkerImage
markerLength + pageBorder[1] * 2) as surface:
AttributeError: exit