|
From: Gustavo P. B. <gb...@us...> - 2005-07-13 03:31:22
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/glcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21028/src/methods/glcm Modified Files: glcm.cpp glcm.h Log Message: Re-enabled caching (but this time working) Index: glcm.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/glcm/glcm.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- glcm.cpp 1 Jul 2005 00:37:20 -0000 1.13 +++ glcm.cpp 13 Jul 2005 03:31:14 -0000 1.14 @@ -54,7 +54,7 @@ { } -void KTGLCM::calculate(KTImage *img, int imgClass) +void KTGLCM::_calculate(KTImage *img, int imgClass) { m_img = img; @@ -133,16 +133,16 @@ y = m_img->gray(col+d,row) / m_quantization; m_glcm[angle][x][y]++; m_glcm[angle][y][x]++; - } - else if (angle == 1 && row + d < rows) + } + else if (angle == 1 && row + d < rows && col - d >= 0) { - y = m_img->gray(col,row+d) / m_quantization; + y = m_img->gray(col-d, row+d) / m_quantization; m_glcm[angle][x][y]++; m_glcm[angle][y][x]++; - } - else if (angle == 2 && row + d < rows && col - d >= 0) + } + else if (angle == 2 && row + d < rows) { - y = m_img->gray(col-d, row+d) / m_quantization; + y = m_img->gray(col,row+d) / m_quantization; m_glcm[angle][x][y]++; m_glcm[angle][y][x]++; } Index: glcm.h =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/glcm/glcm.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- glcm.h 1 Jul 2005 00:37:20 -0000 1.8 +++ glcm.h 13 Jul 2005 03:31:14 -0000 1.9 @@ -38,7 +38,7 @@ ~KTGLCM(); - void calculate(KTImage *img, int imgClass = 0); + void _calculate(KTImage *img, int imgClass = 0); void *data(int direction) const; |