Asg 7: ArUco marker detection

Assignment

Implement marker detection in OpenCV using
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

rvecs, tvecs, _objPpoints = aruco.estimatePoseSingleMarkers(...)
to recover the camera rotation and translation w.r.t. the marker. Note that you have to pass the intrinsic camera matrix 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.

Suggestions (e.g., for Python implementation)

  1. There are probably many suggestions out on the web, e.g.,

Example Program Input

None. Find a short video that you like.

Example Program Output

Ideally an .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.

Turn in

Turn in all of your code, in one tar.gz archive of your asg##/ directory, including:
  1. A README file containing
    1. Course id--section no
    2. Name
    3. Brief solution description (e.g., program design, description of algorithm, etc., however appropriate).
    4. Lessons learned, identified interesting features of your program
    5. Any special usage instructions
  2. Makefile
  3. source code
  4. short video

How to hand in

See handin notes

Grading scheme