35 #ifndef AIMS_MATH_CURV2DISO_H 36 #define AIMS_MATH_CURV2DISO_H 46 template <
class T>
inline 53 curv.setSizeX(mat.
sizeX());
54 curv.setSizeY(mat.
sizeY());
55 float fx,fy,fxx,fyy,fxy;
57 for (
int y=2;y<mat.
dimY()-2;y++)
58 for (
int x=2;x<mat.
dimX()-2;x++)
59 {
if (mat(x-1,y)!=mat(x+1,y) || mat(x,y-1)!=mat(x,y+1))
60 { fx = ((float)mat(x+1,y) - (float)mat(x-1,y) ) / 2;
61 fy = ((float)mat(x,y+1) - (float)mat(x,y-1) ) / 2;
62 fxx = ((float)mat(x+2,y) - 2 * (float)mat(x,y) +
63 (float)mat(x-2,y) ) / 4;
64 fyy = ((float)mat(x,y+2) - 2 * (float)mat(x,y) +
65 (float)mat(x,y-2) ) / 4;
66 fxy = ((float)mat(x+1,y+1) -
69 (float)mat(x-1,y-1) ) / 4;
70 curv(x,y) = (- fxx*fy*fy + 2*fx*fy*fxy - fyy*fx*fx) /
71 cube( sqrt(fx*fx + fy*fy) );
void fillBorder(const T &val)
AimsData< float > AimsIsoIntensityCurvature2D(const AimsData< T > &mat)
2D Curvature functions on an intensity image f(x,y) = I.