Skip to content

Add tests for the view command, and fix several bugs

Tim Starling requested to merge work/tstarling/view-tests into main
  • Add python3-pil as a dependency for the test suite.
  • Use the python image as the base, on the theory that it will require fewer package installs and so a shorter build time.
  • Add integration tests for ViewCommand.
  • Don't use contains() on a bool_switch since it is always true
  • Use the definition of yaw from the Google Street View documentation, don't use the one from libpano. Add a --heading option which is negative yaw, which corresponds to libpano yaw.
  • Add a --invert option, to change the sign of the yaw, pitch and roll angles. This can be used when angles should be interpreted as the "pose" of the input image and the rotation is done to correct that pose and provide a view along the true axis.
  • In extractFaceTpl, factor out a single destScale so that we can get rid of the fovIs90x90 template parameter.
  • There was a glitch related to the reflection optimisation in extractFaceTpl. The right half was offset by a half a pixel, with 0 being reflected to destWidth-1, but the centre line used by the coordinate transformation was at destWidth/2 not (destWidth-1)/2. So take the first pixel of the row outside the loop body, and don't reflect it.
  • With destWidth/2 now being exactly zero in the x/y/z space, we hit two problems with atan2_approx(). One is that atan2(0,0) was encountered at the centre of the top/bottom faces, returning NaN, causing interpolate() to segfault. So add a guarded atan2() which can be used when this is possible.
  • The other is that atan2(1,-0) was not properly propagating the sign from the negative zero, causing it to return -pi/2 instead of pi/2. So use std::signbit() instead of comparison.

Merge request reports