346 
Fishery Bulletin 115(3) 
ter Survey System cameras proceeded according to the 
methods described in Williams et al. (2010, 2013) with 
the Camera Calibration Toolbox for Matlab (Bouguet, 
2014). Calibration images of a submerged (freshwater) 
checkerboard test pattern (9 by 7 matrix of 108-mm 
squares) were captured by each camera of the Modu- 
lar Optical Underwater Survey System at a distance 
of about 3 m. The checkerboard was tilted and rotated 
along all 3 axes into 25 poses, which were held station- 
ary for ~5 s. Paired stereo images were later viewed 
and 1 paired image from ~25 paired images in each 
pose was selected for analysis on the basis of image 
clarity and the required presence of all 4 corners of 
the checkerboard in both images. By using the camera 
calibration software, each of the paired images was se- 
quentially displayed, and the 4 external corners of each 
checkerboard image were manually identified. This in- 
formation was then used to estimate the optical distor- 
tion of each camera and the translation and relative 
rotation of the camera pair to define a measurement 
coordinate system. 
Once calibrated, the 3-dimensional position within 
this coordinate system can be determined for any ob- 
ject in the joint (i.e. overlapping) field of view of the 
stereo cameras. The axes of this coordinate system are 
the y-axis, increasing monotonically with distance from 
the lens of the left camera (optical axis), and the x-axis 
and z-axis, which are measured perpendicular to the 
y-axis in the horizontal (positive to the left, as seen by 
the camera) and the vertical planes (positive upwards). 
Measuring fish positions 
Fish positions were measured from images recorded 
during 2 time periods. The first time period (disturbed 
case) consisted of a 22-s period between the time when 
the tow vessel was at its shortest distance to the ben- 
thic camera (i.e., passage time) and the time when the 
camera vehicle just entered the field of view of the 
benthic camera and the last tracked vermilion snap- 
per completely exited the field of view. The second time 
period (undisturbed case) consisted of a 10-s period 
taken 20 min after the previous vessel passage time 
(an interval which was assumed to be sufficiently long 
to allow disturbed fish to return to their undisturbed 
state) and 5 min before the passage time of the dis- 
turbed case. During the 2 cases, the same school was 
viewed with the same camera under nearly identical 
viewing conditions; consequently the cases were essen- 
tially one sequence with a 5-min break to reduce video 
processing time. 
For each of these 2 periods, paired stereo images 
were processed as follows. During each second, 5 ste- 
reo paired frames were collected, but only frames 2-4 
were used to estimate fish position (although fish posi- 
tion in each second can be estimated with only a single 
frame, estimation of swimming velocity required 3 suc- 
cessive frames). Starting with the first of these frames, 
25 fish were selected at progressively increasing dis- 
tances from the camera. Each fish was then followed 
and positioned (i.e., x, y, z coordinates) sequentially 
through the 3 frames by using the Stereo Tracker ste- 
reo measurement software (Fig. 2; Williams et al. 5 ) and 
techniques described in Williams et al. (2010, 2013). In 
all cases, the fish snout was used as the reference fea- 
ture for measurement because it was the easiest fea- 
ture to consistently locate. Therefore, for each second, 
in both the disturbed and the undisturbed cases, the 
data available for target tracking were the x, y, and 
z coordinate positions of 25 fish individually followed 
through 3 successive frames. To reduce the influence of 
possible random measurement errors, these data were 
smoothed by fitting a straight line to the 3 positions 
of each fish on each coordinate axis as a function of 
time (function 1m in R statistical software, vers. 3.3.1; 
[R Core Team, 2016]), then by using the fitted model 
to predict the positions at the 3 times. The position of 
each fish during each second was subsequently based 
on its smoothed position during the second frame. 
Distance off the bottom 
Because the benthic cameras imaged the bottom, as 
well as the fish, from a fixed position, it was possible to 
construct a topographical map of the bottom expressed 
in the same coordinate system as that used to view the 
fish and then to use this map to determine the distance 
of each fish from the bottom. First, the coordinates of 
30 locations on the bottom were measured with the 
software, and then a topographic map of the bottom 
was estimated by fitting the z coordinates of these posi- 
tions as a smooth function of the x and y coordinates 
by using generalized additive modeling (function gam 
in the mgcv package for R). The fitted function was 
then used to predict the z coordinate of the bottom at 
the x and y coordinates of every fish position, and that 
z coordinate, when negated and added to the z coordi- 
nate of the fish itself, produced the distance off bottom 
( d ) in each frame for every fish. The group distance off 
bottom ( D ) during each second was then calculated as 
the mean of the d values for all the fish in the group. 
Tracking the camera vehicle to determine its sampling path 
The stereo cameras were used to position the forward, 
right-hand corner of the camera vehicle frame at 3 
times during its passage through the field of view of 
the benthic camera to calculate its trajectory on the 
horizontal plane. The trajectory, which was assumed to 
follow a straight line, was estimated by fitting straight 
lines to the x and y coordinates individually as a func- 
tion of time. Because the trajectory was nearly paral- 
lel to the x-axis, the trajectory of the camera vehicle 
center line was estimated by adding the half width of 
5 Williams, K., R. Towler, P. Goddard, R. Wilborn, and C. Roop- 
er. 2016. Sebastes stereo image analysis software. AFSC 
Processed Rep. 2016-03, 42 p. Alaska Fish. Sci. Cent., Natl. 
Mar. Fish. Serv., 7600 Sand Point Way NE, Seattle, WA 
98115. Report 
