看图片,看代码:
List<int[]> 第一组dog五层金字塔 = new List<int[]>();
第一组dog五层金字塔.Add(oct1dog2layer512);//第一组dog五层金字塔[0]
第一组dog五层金字塔.Add(oct1dog3layer512);//第一组dog五层金字塔[1]
第一组dog五层金字塔.Add(oct1dog4layer512);//第一组dog五层金字塔[2]
int L = 1;
List<Point> keyPt = new List<Point>();
List<int> keyPtVal = new List<int>();
for (int j = 1 + 4; j < 512 - 1 - 4; j++) //行循环遍历//他们说靠近边缘5个像素不处理,
{
for (int i = 1 + 4; i < 512 - 1 - 4; i++) //列循环遍历//他们说靠近边缘5个像素不处理
{
int temp = j * 512 + i;
//开始寻找最值点
int val = 第一组dog五层金字塔[L][temp];//从第二层dog金字塔开始L=1
if (val >0)//极大值检测,观察后得到的门槛值
{
if(val>=10)//观察后,有关形成干扰的极值点排除,9*8*9空间26个像素对比
if (val < 第一组dog五层金字塔[L][temp + 1] && val < 第一组dog五层金字塔[L][temp - 1] && val < 第一组dog五层金字塔[L][temp + 1 + 512] && val < 第一组dog五层金字塔[L][temp + 512] && val < 第一组dog五层金字塔[L][temp + 512 - 1] && val < 第一组dog五层金字塔[L][temp + 1 - 512] && val < 第一组dog五层金字塔[L][temp - 512] && val < 第一组dog五层金字塔[L][temp - 512 - 1] &&
val < 第一组dog五层金字塔[L - 1][temp + 1] && val < 第一组dog五层金字塔[L - 1][temp - 1] && val < 第一组dog五层金字塔[L - 1][temp + 1 + 512] && val < 第一组dog五层金字塔[L - 1][temp + 512] && val < 第一组dog五层金字塔[L - 1][temp + 512 - 1] && val < 第一组dog五层金字塔[L - 1][temp + 1 - 512] && val < 第一组dog五层金字塔[L - 1][temp - 512] && val < 第一组dog五层金字塔[L - 1][temp - 512 - 1] && val < 第一组dog五层金字塔[L - 1][temp] &&
val < 第一组dog五层金字塔[L + 1][temp + 1] && val < 第一组dog五层金字塔[L + 1][temp - 1] && val < 第一组dog五层金字塔[L + 1][temp + 1 + 512] && val < 第一组dog五层金字塔[L + 1][temp + 512] && val < 第一组dog五层金字塔[L + 1][temp + 512 - 1] && val < 第一组dog五层金字塔[L + 1][temp + 1 - 512] && val < 第一组dog五层金字塔[L + 1][temp - 512] && val < 第一组dog五层金字塔[L + 1][temp - 512 - 1] && val < 第一组dog五层金字塔[L + 1][temp])
{
continue;
}
else
{
int r1 = j, c1 = i, layer = L;
double contrastThreshold = 0.04;
double edgeThreshold = 10.0;
// 关键点精确定位