fehlfarbe / python-aruco

Python wrappers for ArUco library
Other
66 stars 16 forks source link

Creation of Fractal markers using aruco 3.1.12 #43

Open milind1097 opened 3 years ago

milind1097 commented 3 years ago

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

fehlfarbe commented 3 years ago

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.

milind1097 commented 3 years ago

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