// 但是不成功,不知道为何),那么就认为这个是指尖
if (dist != max)
{
count++;
if (count > 40)
{
count = 0;
max = 0;
bool flag = false;
// 低于手心的点不算
if (center.y < couPoint[notice].y )
continue;
// 离得太近的不算
for (int j = 0; j < fingerTips.size(); j++)
{
if (abs(couPoint[notice].x - fingerTips[j].x) < 20)
{
flag = true;
break;
}
}
if (flag) continue;
fingerTips.push_back(couPoint[notice]);
circle(show_img, couPoint[notice], 6 ,Scalar(0, 255, 0), CV_FILLED);
line(show_img, center, couPoint[notice], Scalar(255, 0, 0), 2);
}
}
}
imshow("show_img", show_img);
if ( cvWaitKey(20) == 'q' )
break;
}
return 0;
}
//肤色提取,skinArea为二值化肤色图像