43 #ifndef vpImageMorphology_H
44 #define vpImageMorphology_H
51 #include <visp/vpImage.h>
52 #include <visp/vpImageException.h>
53 #include <visp/vpMatrix.h>
122 for (
unsigned int i=1 ; i < I.
getHeight()-1 ; i++)
123 for (
unsigned int j=1 ; j < I.
getWidth()-1 ; j++)
125 if (I[i][j] == value)
128 if ((I[i-1][j] == value_out) ||
129 (I[i+1][j] == value_out) ||
130 (I[i][j-1] == value_out) ||
131 (I[i][j+1] == value_out))
137 for (
unsigned int i=1 ; i < I.
getHeight()-1 ; i++)
138 for (
unsigned int j=1 ; j < I.
getWidth()-1 ; j++)
140 if (I[i][j] == value)
143 if ((I[i-1][j-1] == value_out) ||
144 (I[i-1][j] == value_out) ||
145 (I[i-1][j+1] == value_out) ||
146 (I[i][j-1] == value_out) ||
147 (I[i][j+1] == value_out) ||
148 (I[i+1][j+1] == value_out) ||
149 (I[i+1][j+1] == value_out) ||
150 (I[i+1][j+1] == value_out) )
151 J[i][j] = value_out ;
186 for (
unsigned int i=1 ; i < I.
getHeight()-1 ; i++)
187 for (
unsigned int j=1 ; j < I.
getWidth()-1 ; j++)
189 if (I[i][j] == value_out)
192 if ((I[i-1][j] == value) ||
193 (I[i+1][j] == value) ||
194 (I[i][j-1] == value) ||
195 (I[i][j+1] == value))
201 for (
unsigned int i=1 ; i < I.
getHeight()-1 ; i++)
202 for (
unsigned int j=1 ; j < I.
getWidth()-1 ; j++)
204 if (I[i][j] == value_out)
207 if ((I[i-1][j-1] == value) ||
208 (I[i-1][j] == value) ||
209 (I[i-1][j+1] == value) ||
210 (I[i][j-1] == value) ||
211 (I[i][j+1] == value) ||
212 (I[i+1][j+1] == value) ||
213 (I[i+1][j+1] == value) ||
214 (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.