Files
HandWritten-Analisys/测试/本机测试/2-侯-算法/handwriting/Integral.cpp
yanshui177 962de04ffb 笔迹鉴别程序
考试的笔迹鉴别程序,分辨出不同人写的笔迹
2017-05-17 16:50:37 +08:00

29 lines
846 B
C++

/*
IplImage* Integral(IplImage* img, int width, int height)
{
unsigned long *columnSum = new unsigned long[width]; // sum of each column
// calculate integral of the first line
for(int i=0;i<width;i++)
{
columnSum[i]=inputMatrix[i];
outputMatrix[i] = inputMatrix[i];
if(i>0)
{
outputMatrix[i] += outputMatrix[i-1];
}
}
for (int i=1;i<height;i++)
{
int offset = i*width;
// first column of each line
columnSum[0] +=inputMatrix[offset];
outputMatrix[offset] = columnSum[0];
// other columns
for(int j=1;j<width;j++)
{
columnSum[j] += inputMatrix[offset+j];
outputMatrix[offset+j] = outputMatrix[offset+j-1] + columnSum[j];
}
}
return 0;
} */