# 前言

### Question 1

• What is the accuracy of your estimation?  theoretical_gsc =

computed_gsc =

accuracy =

As the data above, accuracy of the estimation is equal to theoretical `gsc` minus computed `gsc`.

### Question 2

• Do you get better accuracy with more markers in step 7? Compare the localization results derived from an image with only 1 marker, 2 markers and 3 markers by averaging the exponential coordinates. Justify with experiment.  computed_gsc1 =

accuracy1 =  computed_gsc2 =

accuracy2 =  computed_gsc3 =

accuracy3 =

When a marker is attached to another plane in three dimensions, the accuracy of the elements in the matrix generated by the computer program is improved. This precise degree of improvement is precisely the same as the matrix generated by multiple marker programs in the same 3D plane.

### Question 3

• In step 7, do you get better accuracy if you combine the results from multiple photos taken at the same position?  computed_gsc1 = computed_gsc2 = computed_gsc3 =

computed_gsc =

accuracy =

When combining two images, the accuracy was not significantly increased. It may be because the difference between the two images is small. When we introduced the third image, the accuracy of some elements in the matrix did improve. It may be because we introduced more images, which balanced the accuracy problems caused by various problems. By analogy, we concluded that keeping the camera’s spatial position constant, combined with more images can be an exact improvement of certain elements in the matrix.

### Question 4

• Assume you are given a mobile robot with camera on board in a relatively large environment (i.e. you may not capture marker from every position of the robot). One possible option, you can use the same technique but placing as many markers as possible so that you will detect at least one marker from any instance. However, this will come at higher cost. How would you solve this problem? How you will optimize the usage of markers? Elaborate the strategy. We have summarized three methods through multiple measurements. The first is to attach markers in all three three-dimensional planes, so that the z-axis detected by the program will be more accurate. The second method is to keep the position of the camera from multiple angles while maintaining the previous method. The third method is to increase the photo pixels. When the marker is far away from the camera, it will be difficult to recognize or the accuracy of the recognition will decrease. Increasing the camera pixels can improve the recognition accuracy.

### The difficulties we faced & The strategies we adopted

1. At the time of encoding, we found that the functions we used in the opencv.aruco class were packaged, which meant that we could not understand the principles of these functions. Therefore, we have to read the documentation again and again to try to fully understand these features.
2. Because these functions are written in C++ in tutorials, we have to translate them into python. And the features between C++ and Python raised some issues. For example, python cannot use undefined parameters. Therefore, we have to test each function in Python.
3. The code in the tutorials is for “Charucoboard” and we need “Markers”. In order to achieve this goal, we must change some parameters. For example, change the function “ estimatePoseCharucoBoard” to “ estimatePoseSingleMarkers”. These two functions have different kinds of parameters.
4. In order to find the spatial frame, we need to display origin[0 0 0] in the camera, which means we need to draw three axes, representing the x, y, and z axes. The problem is that the parameter used by the “estimatePoseSingleMarkers” function is of type numpy.ndarray, we have to create a matrix for that type, otherwise the program will declare an error.
5. The program cannot recognize multiple markers at first, until we loop the function “ drawAxis”. After modifying the code, the issue has been resolved.
6. I can’t distinguish the “marker” IDs, so I use “cv2.putText” function to print the ID in the output image.
7. Light is an important factor. Accuracy errors are caused by differences in light between calibration and estimation. When estimating, I will try to imitate the same lighting environment.
8. We use a Macbook camera, but the camera is already embedded in the laptop. So even we made the camera parallel to the space frame, it is hard to measure the exact distance from the camera to the space frame.
9. We use the “Photo Booth” app to capture images. We found that the size of the image output using the “cv2.VideoCapture” function is different from the output image. Therefore, the input images we use are all taken by the same application.
10. We don’t have a tape measure, so we made it ourselves. Therefore the distence may not be very accurate. And we also don’t have protractors. Therefore, we can only make the camera perpendicular to the space frame.