corners, ids, rejected = aruco.detectMarkers(...)
which will return a list of detected markers (there may be more than one,
watch out!).
Be sure to specify the correct dictionary that you used to generate the
markers, e.g., using this
ArUco Marker Generator.
The generator allows specification of several dictionaries.
The 4x4
dictionary is a good one to use and in code (Python)
you would specify this as aruco.DICT_4x4_50
. Be sure to
measure the actual physical dimension of the marker so you know the marker
length.
Then use
to recover the camera rotation and translation w.r.t. the marker. Note that
you have to pass the intrinsic camera matrix
rvecs, tvecs, _objPpoints = aruco.estimatePoseSingleMarkers(...)
K
and distortion
coefficients dist
to this function.
In this assignment, try specifying a virtual rectangle that you want to draw in relation to the maker. The key is test whether the virtual rectangle rotates and translates properly, in the same way the marker does. Be sure to test rotation about each of the three axes.
.mp4
video could be made, although that
may need to be encoded post-facto by ffmpeg as OpenCV might only output
raw video, e.g., output.mp4.
tar.gz
archive of your asg##/ directory, including:
README
file containing
Makefile
handin
notes