34 #include <visp3/core/vpConfig.h>
42 #if defined(VISP_HAVE_CATCH2)
43 #define CATCH_CONFIG_RUNNER
46 #include <visp3/core/vpImageTools.h>
47 #include <visp3/core/vpIoTools.h>
48 #include <visp3/io/vpImageIo.h>
50 #ifdef ENABLE_VISP_NAMESPACE
54 TEST_CASE(
"Test vpImageTools::imageAdd()",
"[image_add]")
60 SECTION(
"I + Inull = I")
68 SECTION(
"I + I without saturation")
70 const bool saturation =
false;
72 common_tools::imageAddRef(I, I, Iref, saturation);
76 CHECK((Iadd == Iref));
79 SECTION(
"I + I with saturation")
81 const bool saturation =
true;
83 common_tools::imageAddRef(I, I, Iref, saturation);
87 CHECK((Iadd == Iref));
91 TEST_CASE(
"Test vpImageTools::imageDifference()",
"[image_difference]")
97 SECTION(
"I - Inull = I")
105 SECTION(
"I - I2 without saturation")
107 const bool saturation =
false;
110 common_tools::fill(I2);
112 common_tools::imageSubtractRef(I, I2, Iref, saturation);
116 CHECK((Isub == Iref));
119 SECTION(
"I - I2 with saturation ")
121 const bool saturation =
true;
124 common_tools::fill(I2);
126 common_tools::imageSubtractRef(I, I2, Iref, saturation);
130 CHECK((Isub == Iref));
134 int main(
int argc,
char *argv[])
136 Catch::Session session;
139 session.applyCommandLine(argc, argv);
141 int numFailed = session.run();
149 int main() {
return EXIT_SUCCESS; }
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
unsigned int getWidth() const
unsigned int getHeight() const