20SCENARIO(
"Verify X-Corr with center of light calculation",
"[improc::imageXCorrDiscrete]" )
22 GIVEN(
"two Gaussians" )
24 WHEN(
"1 at geometric center" )
30 mx::math::func::gaussian2D<double>( im0.data(), im0.rows(), im0.cols(), 0., 1.0, 31.5, 31.5, 2 );
31 mx::math::func::gaussian2D<double>( im2.data(), im2.rows(), im2.cols(), 0., 1.0, 31.5 + 4, 31.5 + 4, 2 );
38 xcf.m_peakMethod = mx::improc::xcorrPeakMethod::centroid;
42 std::cerr << x <<
" " << y <<
"\n";
44 REQUIRE_THAT( x, Catch::Matchers::WithinAbs( 2, 1e-8 ) );
45 REQUIRE_THAT( y, Catch::Matchers::WithinAbs( 2, 1e-8 ) );
47 WHEN(
"geometric quarter" )
52 mx::math::func::gaussian2D<double>( im.data(), im.rows(), im.cols(), 0., 1.0, 15.5, 15.5, 2 );
57 REQUIRE_THAT( x, Catch::Matchers::WithinAbs( 15.5, 1e-8 ) );
58 REQUIRE_THAT( y, Catch::Matchers::WithinAbs( 15.5, 1e-8 ) );