Skip to content

Wrong shape of Python Aruco dictionary bytesList? #1939

@abetusk

Description

@abetusk
System information (version)
  • OpenCV => 4.0.0-dev
  • Operating System / Platform => debian 9.4 (64 Bit)
  • Compiler => gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Detailed description

I'm not sure this is a bug or not but I'm filing in case it is.

When investigating loading a custom Aruco Dictionary for Python (2.7) I noticed the bytesList looks (to me) as if it's been reshaped improperly, going from a 4 row by 5 column array in the predefined_dictionaries.hpp to a 5 row by 4 column array in Python.

For example, here is a short Python snippet:

>>> print cv2.aruco.Dictionary_get(cv2.aruco.DICT_6X6_250).bytesList
[[[ 30  61 216  42]
  [  6 227 186  70]
  [ 49   9 101  65]
  [187 199   8 152]
  [198  37 220   7]]
...
>>> print cv2.aruco.Dictionary_get(cv2.aruco.DICT_6X6_250).bytesList.shape
(250, 5, 4)

And the relevant code snippet in predefined_dictionaries.hpp:

...
static unsigned char DICT_6X6_1000_BYTES[][4][5] =
    { { { 30, 61, 216, 42, 6 },
        { 227, 186, 70, 49, 9 },
        { 101, 65, 187, 199, 8 },
        { 152, 198, 37, 220, 7 }, },
...

Note that the data is all there, it just looks like the shape of the matrix is wrong in Python.

I would like to load a custom Aruco dictionary through Python which presumably means I would need to feed in a bytesList with the oddly shaped format in Python. Since, as far as I can tell, bytesList is part of the specification and needs to be populated for custom Aruco dictionaries, even if it's being used consistently in the OpenCV library the portion exposed seems incorrect.

Steps to reproduce

See above, but for redundancies sake (in Python):

>>> print cv2.aruco.Dictionary_get(cv2.aruco.DICT_6X6_250).bytesList
[[[ 30  61 216  42]
  [  6 227 186  70]
  [ 49   9 101  65]
  [187 199   8 152]
  [198  37 220   7]]
...
>>> print cv2.aruco.Dictionary_get(cv2.aruco.DICT_6X6_250).bytesList.shape
(250, 5, 4)

Metadata

Metadata

Labels

category: arucoconfirmedThere is stable reproducer / investigation complete

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions