39 #include <visp3/core/vpImageMorphology.h> 41 #include <Simd/SimdLib.hpp> 69 std::cerr <<
"Input image is empty!" << std::endl;
73 const unsigned char null_value = 255;
77 for (
unsigned int i = 0; i < J.getHeight(); i++) {
78 if (i == 0 || i == J.getHeight() - 1) {
79 for (
unsigned int j = 0; j < J.getWidth(); j++) {
84 memcpy(J[i] + 1, I[i - 1],
sizeof(
unsigned char) * I.
getWidth());
85 J[i][J.getWidth() - 1] = null_value;
90 connexity ==
CONNEXITY_4 ? SimdImageConnexity4 : SimdImageConnexity8);
119 std::cerr <<
"Input image is empty!" << std::endl;
123 const unsigned char null_value = 0;
127 for (
unsigned int i = 0; i < J.getHeight(); i++) {
128 if (i == 0 || i == J.getHeight() - 1) {
129 for (
unsigned int j = 0; j < J.getWidth(); j++) {
130 J[i][j] = null_value;
133 J[i][0] = null_value;
134 memcpy(J[i] + 1, I[i - 1],
sizeof(
unsigned char) * I.
getWidth());
135 J[i][J.getWidth() - 1] = null_value;
140 connexity ==
CONNEXITY_4 ? SimdImageConnexity4 : SimdImageConnexity8);
static void dilatation(vpImage< Type > &I, Type value, Type value_out, vpConnexityType connexity=CONNEXITY_4)
Type * bitmap
points toward the bitmap
static void erosion(vpImage< Type > &I, Type value, Type value_out, vpConnexityType connexity=CONNEXITY_4)
unsigned int getHeight() const
unsigned int getSize() const
unsigned int getWidth() const