# Tracking Sensor Location by Video Analysis in Double-Shell Tank Inspections
## 2 Materials and Methods  
### Prediction of Distance Moved from Analysis of Video Acquired during Movement  
_This Work Was Previously Reported [7] and Included Here for a Complete Discussion of Our Method of Sensor Tracking by Video Analysis_  
Triangle similarity [11] is the standard method for predicting the distance between camera and object from a photograph of the object. Calibration of the method determines the apparent focal length of the camera F = PD/W, where D is distance to an object of known width, W, and P is the width of the object in pixels in the photograph. Given F, we can calculate distance D = WF/P to any object of known width, W, from its image width in pixels, P. This method can be applied to predict distance moved by video analysis if we know P\({}_{1}\) and P\({}_{2}\) and the image widths of an object of known width, W, in earlier and later video frames, respectively. Then, the camera has moved a distance, WF/P\({}_{1}\)-WF/P\({}_{2}\), toward the object in the time between those frames.  
As seen in Figure 4, which comes from a video taken during inspection of air slot 31-1 in DST AP-107 [12], the top edges of the air slot can be easily detected in video analysis due to the difference in color and texture between tank bottom and channel walls. The blue arrow points to a target that is a good choice if the robot is moving toward the target. The increase in apparent channel width at the target in a later video frame can be used to determine how far the camera has moved toward the target in the time interval between frames. We used the output from Canny edge detection [13; 14] to fit lines to the edges where walls of the air slot meet the bottom of the primary tank. For extended targets, like those pointed out by the black and yellow arrows, a connection to a point on the edge where the apparent width will be calculated is made by a line perpendicular to the fit to the edge through the chosen point.  
The width of an air slot is constant for any of the straight sections that make up the air slot network (see Figure 1), and the value is known from construction drawings. To  
Figure 4: Analysis of video from front camera in visual inspection of an air slot. The red line shows a fit to points from the edge detection of the contact between the air slot wall and the tank bottom. Arrows show possible targets where apparent width of the top of the air slot will be calculated in the current and later frames.  
Figure 3: A three-car robot, called RAVIS, used to move the ultrasonic sensor in the middle of the car through air slots.  
use this information as the known width in calculations of the distance from the camera to the selected target, we need to know the apparent width of the air slot in the image, even though we do not know the point on the opposite edge that is directly opposite the target. This problem was solved and reported in [7] by a combination of analytical geometry and laboratory measurements illustrated by Figure 5.  
If the camera is aligned with the central axis of the channel, then the lines fit to the top edges of an air slot will form two sides of an isosceles triangle with a base that is the apparent width of the channel at the target in the video frame. We refer to the value calculated from this ideal geometry as the \"isosceles triangle\" approximation. The perspective of the channel image in each video frame will not be ideal; hence, corrections to the isosceles triangle approximation were determined empirically with data from the laboratory mockup of the air slot shown in Figure 5 with graph-paper lining. A linear fit to these corrections as a function of the slope of the edge containing the target led to a model that reproduced experimental results with an error of less than 5%. The accuracy of this method to predict distance moved from video acquired during the movement was tested by comparison to laser rangefinder measurements and found to be within the requirements for use in NDE of DSTs.