## 3 Algorithm Flowchart  
The proposed algorithm aims to search and move the camera to the location where the least number of pictures are needed to reduce the noise level of the averaged image to a degree \(\sigma_{noise\_reduct}\). A flowchart describing the algorithm is shown in Figure 5.  
A camera, mounted on a 6-joint robot manipulator, moves freely in 6 degrees of freedom (6 DoFs) in space. Assuming the camera is fixed in orientation towards the face of the object of interest, only the position (3 DoFs) of the camera can vary from the movement of the robot arm. The camera can only move to the locations within the maximum reach of the robot manipulator, and the object can only be detectable within the view angle of the camera. These constraints create a camera operational space (Figure 6a), which is then gridded with a certain resolution of distance. All the intersections of grids come up with a set of nodes (\(S_{total}\)), which are all possible candidates of locations that the camera may move and search utilizing the algorithm. Each node is indexed and denoted as \(Node_{index}\).  
The algorithm iteratively commands the camera to take a picture at one location, generate the next target location, and move to that location until it finds the optimal location that requires the least number of pictures. In one iteration, the camera takes a photo at the current location \(P^{C}\), and after image processing, which transforms a picture into a pixel's intensity matrix, it produces a noisy image with an intensity matrix \(I_{a}\). A previously developed algorithm [30] estimates the noise level \(\sigma_{a}\) across the image. Then, at the current location of the camera, the number of pictures \(N^{C}\) needed to reduce the noise level to \(\sigma_{noise\_reduct}\) is calculated by the equation: \(N^{C}=(\frac{\sigma_{noise\_reduct}}{\sigma_{noise\_reduct}})^{2}\). Based on this information (\(N^{C}\) at \(P^{C}\)), the algorithm then generates the next target location of the camera, \(P^{Next}\). The decision-making process of generating \(P^{Next}\) is illustrated in the dashed circle of the below figure. In general, this algorithm first determines, from the current location \(P^{C}\), the set of grid nodes that can be explorable (\(S_{explored}\)) in the next iteration based on the available moving energy \(E\). Then, a hash map regarding the estimated number of pictures required  
Figure 5: Algorithm flowchart. (The red arrows refer to processes involving hardware of the system, and the blue arrows refer to processes executed only with software).  
for each explorable node (\(M_{explorable}\)) is evaluated from an estimation function that utilizes data from the hash map of all explored nodes (\(M_{explored}\)). A stochastic process further modifies the hash map \(\widehat{M}_{explorable}\) to add fidelity to the estimation model. In the end, the next node's location \(P^{Next}\) is selected so that it has the smallest number of images required among all nodes in \(\widehat{M}_{explorable}\). If the next generated target position \(P^{Next}\) is the same as the current position \(P^{C}\), \(P^{C}\) is the optimal location, and the camera stays and observes the object at this location. Otherwise, the robot joint controller moves the robot joint angles to the targets \(\overline{q}\) (calculated from forward kinematics [31] (Appendix B, Equations (A1)-(A5))) so that the camera will move to the next target position, \(P^{Next}\).