36 #include <visp3/core/vpConfig.h> 44 #if defined(VISP_HAVE_CATCH2) 45 #define CATCH_CONFIG_RUNNER 47 #include <visp3/core/vpImageTools.h> 48 #include <visp3/core/vpIoTools.h> 49 #include <visp3/io/vpImageIo.h> 52 TEST_CASE(
"Test vpImageTools::imageAdd()",
"[image_add]") {
58 SECTION(
"I + Inull = I")
66 SECTION(
"I + I without saturation")
68 const bool saturation =
false;
70 common_tools::imageAddRef(I, I, Iref, saturation);
74 CHECK((Iadd == Iref));
77 SECTION(
"I + I with saturation")
79 const bool saturation =
true;
81 common_tools::imageAddRef(I, I, Iref, saturation);
85 CHECK((Iadd == Iref));
89 TEST_CASE(
"Test vpImageTools::imageDifference()",
"[image_difference]") {
95 SECTION(
"I - Inull = I")
103 SECTION(
"I - I2 without saturation")
105 const bool saturation =
false;
108 common_tools::fill(I2);
110 common_tools::imageSubtractRef(I, I2, Iref, saturation);
114 CHECK((Isub == Iref));
117 SECTION(
"I - I2 with saturation ")
119 const bool saturation =
true;
122 common_tools::fill(I2);
124 common_tools::imageSubtractRef(I, I2, Iref, saturation);
128 CHECK((Isub == Iref));
132 int main(
int argc,
char *argv[])
134 Catch::Session session;
137 session.applyCommandLine(argc, argv);
139 int numFailed = session.run();
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
unsigned int getHeight() const
unsigned int getWidth() const