3 #include "../../catch2/catch.hpp"
8 #define MX_NO_ERROR_REPORTS
10 #include "../../../include/math/func/gaussian.hpp"
11 #include "../../../include/improc/imageUtils.hpp"
12 #include "../../../include/improc/eigenCube.hpp"
20 SCENARIO(
"Verify center of light calculation",
"[improc::imageCenterOfLight]" )
24 WHEN(
"geometric center")
29 mx::math::func::gaussian2D<double>(im.data(), im.rows(), im.cols(), 0., 1.0, 31.5, 31.5, 2);
34 REQUIRE(fabs(x-31.5) < 1e-8 );
35 REQUIRE(fabs(y-31.5) < 1e-8 );
37 WHEN(
"geometric quarter")
42 mx::math::func::gaussian2D<double>(im.data(), im.rows(), im.cols(), 0., 1.0, 15.5, 15.5, 2);
47 REQUIRE(fabs(x-15.5) < 1e-8 );
48 REQUIRE(fabs(y-15.5) < 1e-8 );
Eigen::Array< scalarT, -1, -1 > eigenImage
Definition of the eigenImage type, which is an alias for Eigen::Array.
int imageCenterOfLight(typename imageT::Scalar &x, typename imageT::Scalar &y, const imageT &im)
Calculate the center of light of an image.
SCENARIO("Verify center of light calculation", "[improc::imageCenterOfLight]")