39 #ifndef vpImageMorphology_H
40 #define vpImageMorphology_H
47 #include <visp3/core/vpImage.h>
48 #include <visp3/core/vpImageException.h>
49 #include <visp3/core/vpMatrix.h>
118 for (
unsigned int i=1 ; i < I.
getHeight()-1 ; i++)
119 for (
unsigned int j=1 ; j < I.
getWidth()-1 ; j++)
121 if (I[i][j] == value)
124 if ((I[i-1][j] == value_out) ||
125 (I[i+1][j] == value_out) ||
126 (I[i][j-1] == value_out) ||
127 (I[i][j+1] == value_out))
133 for (
unsigned int i=1 ; i < I.
getHeight()-1 ; i++)
134 for (
unsigned int j=1 ; j < I.
getWidth()-1 ; j++)
136 if (I[i][j] == value)
139 if ((I[i-1][j-1] == value_out) ||
140 (I[i-1][j] == value_out) ||
141 (I[i-1][j+1] == value_out) ||
142 (I[i][j-1] == value_out) ||
143 (I[i][j+1] == value_out) ||
144 (I[i+1][j+1] == value_out) ||
145 (I[i+1][j+1] == value_out) ||
146 (I[i+1][j+1] == value_out) )
147 J[i][j] = value_out ;
182 for (
unsigned int i=1 ; i < I.
getHeight()-1 ; i++)
183 for (
unsigned int j=1 ; j < I.
getWidth()-1 ; j++)
185 if (I[i][j] == value_out)
188 if ((I[i-1][j] == value) ||
189 (I[i+1][j] == value) ||
190 (I[i][j-1] == value) ||
191 (I[i][j+1] == value))
197 for (
unsigned int i=1 ; i < I.
getHeight()-1 ; i++)
198 for (
unsigned int j=1 ; j < I.
getWidth()-1 ; j++)
200 if (I[i][j] == value_out)
203 if ((I[i-1][j-1] == value) ||
204 (I[i-1][j] == value) ||
205 (I[i-1][j+1] == value) ||
206 (I[i][j-1] == value) ||
207 (I[i][j+1] == value) ||
208 (I[i+1][j+1] == value) ||
209 (I[i+1][j+1] == value) ||
210 (I[i+1][j+1] == value) )
Various mathematical morphology tools, erosion, dilatation...
static void dilatation(vpImage< Type > &I, Type value, Type value_out, vpConnexityType connexity=CONNEXITY_4)
unsigned int getWidth() const
static void erosion(vpImage< Type > &I, Type value, Type value_out, vpConnexityType connexity=CONNEXITY_4)
unsigned int getHeight() const
Definition of the vpImage class member functions.