本文介绍了检测置信度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
关于以下文档:
http:// msdn.microsoft.com/en-us/library/microsoft.kinect.facetracking.iftfacetracker.detectfaces.aspx
http://msdn.microsoft.com/en-us/library/microsoft.kinect.facetracking.iftfacetracker.detectfaces.aspx
DetecFaces方法中的pFaces参数应返回[0,1中的值] ]。
the pFaces argument in the DetecFaces method should return a value in [0, 1].
当我使用这种方法时,我得到的值超出了这个间隔。应该导致什么?如何在[0,1]中对它们进行标准化?
When I am using this method, I am getting values beyond this interval. What should be causing it? How can I normalize them in [0, 1]?
下面的代码片段如下:
// Do face tracking
if (SUCCEEDED(hrCopy))
{
FT_SENSOR_DATA sensorData(m_colorImage, m_depthImage, m_pKinectSensor->GetZoomFactor(), m_pKinectSensor->GetViewOffSet());
FT_VECTOR3D* hint = NULL;
if (SUCCEEDED(m_pKinectSensor->GetClosestHint(m_hint3D)))
{
hint = m_hint3D;
}
if (m_LastTrackSucceeded)
{
hrFT = m_pFaceTracker->ContinueTracking(&sensorData, hint, m_pFTResult);
}
else
{
hrFT = m_pFaceTracker->StartTracking(&sensorData, NULL, hint, m_pFTResult);
}
RECT roi;
HRESULT hr = m_pFTResult->GetFaceRect(&roi);
bool hasFoundFace = (SUCCEEDED(hr) && (roi.bottom != roi.top && roi.left != roi.right));
FT_WEIGHTED_RECT* faceConfidence = new FT_WEIGHTED_RECT();
UINT pFaceCount = 1;
hr = m_pFaceTracker->DetectFaces(&sensorData, hasFoundFace ? &roi : NULL, faceConfidence, &pFaceCount);
if (SUCCEEDED(hr) && hasFoundFace)
{
m_faceConfidence = faceConfidence->Weight;
}
delete faceConfidence;
}
推荐答案
if(SUCCEEDED(hrFT) && SUCCEEDED(m_pFTResult->GetStatus()))
{
// detect code
}
这篇关于检测置信度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!