谁能帮忙解释一下程序所用的原理??是关于图像配准的,把特征点分类的算法。谢谢!
static void check_dense( CvSeq* features, int* dense_array, unsigned char check_distance[458][501])
{
struct feature* feat;
long row, line, a, b;
int sum;
for(row = 42; row <= 425; row += 31)
for(line = 44; line <= 458; line += 31)
{
if((row - 233) * (row - 233)/400 + (line - 248) * (line - 248)/484 <= 100)
{
sum=0;
for(a = row - 15;a <= row + 15; ++a)
for(b = line - 15;b <= line + 15; ++b)
if(check_distance[a][b] >= 100) sum += check_distance[a][b] - 99;
else sum += check_distance[a][b];
if( sum > 20)//纯绿
{
for(a = row - 15;a <= row + 15; ++a)
for(b = line - 15;b <= line + 15;++b)
if(check_distance[a][b] >= 100)
{
feat = CV_GET_SEQ_ELEM( struct feature, features, *(dense_array + b * 458 + a) );
feat->dense = 4;
}
}
else if( sum > 14)//淡红
{
for(a = row - 15;a <= row + 15; ++a)
for(b = line - 15;b <= line + 15;++b)
if(check_distance[a][b] >= 100)
{
feat = CV_GET_SEQ_ELEM( struct feature, features, *(dense_array + b * 458 + a) );
feat->dense = 3;
}
}
else if( sum > 7)//纯蓝
{
for(a = row - 15;a <= row + 15; ++a)
for(b = line - 15;b <= line + 15;++b)
if(check_distance[a][b] >= 100)
{
feat = CV_GET_SEQ_ELEM( struct feature, features, *(dense_array + b * 458 + a) );
feat->dense = 2;
}
}
else //灰色
{
for(a = row - 15;a <= row + 15; ++a)
for(b = line - 15;b <= line + 15;++b)
if(check_distance[a][b] >= 100)
{
feat = CV_GET_SEQ_ELEM( struct feature, features, *(dense_array + b * 458 + a) );
feat->dense = 1;
}
}
}
}