python-aruco icon indicating copy to clipboard operation
python-aruco copied to clipboard

Creation of Fractal markers using aruco 3.1.12

Open milind1097 opened this issue 4 years ago • 2 comments

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. :)

milind1097 avatar Dec 25 '20 08:12 milind1097

Yep, the Python lib is just a wrapper so everything that works with the C++ lib should work with the Python wrapper in a similar way. This is an example script to draw a fractal marker:

import cv2
import aruco


if __name__ == "__main__":

    fractalmarkerSet = aruco.FractalMarkerSet.loadPredefined(aruco.FractalMarkerSet.FRACTAL_4L_6)
    pixSize = 10
    border = True

    result = fractalmarkerSet.getFractalMarkerImage(pixSize, border)
    cv2.imshow("fractal", result)
    cv2.waitKey(0)

There are predefined fractal markers in aruco.FractalMarkerSet.FRACTAL_XXXX

I got the code from the aruco C++ package. In utils_fractal there are C++ source files for creating and printing markers.

fehlfarbe avatar Dec 26 '20 23:12 fehlfarbe

Ah alright. Thanks, I will look into it regarding how can we obtain customized markers. The pixSize = 10 that you used, is that a random number or can we take any number based on our requirements?

Thanks. :)

milind1097 avatar Dec 29 '20 16:12 milind1097