如何规范从Kinect C#中提取的功能?

时间:2019-05-20 13:11:02

标签: c# kinect normalization

我正在做一个项目,用C#中的Kinect提取嘴唇特征。我的问题是如何对功能进行归一化?

我认为我必须执行以下功能:

Nd =(Cd * Fd)/ dFN

其中Nd是归一化的距离,Cd是到Kinect的当前距离,Fd是每帧均被归一化的前额深度值,dFN是每帧都被归一化的深度值。

此外,还必须实现z分数归一化:

z =(X-μ)/σ

其中z是z得分归一化的结果,X是当前特征值,μ是在一个数据库中获得的平均值,σ表示方差。

如何根据功能进行归一化?

以下是我要归一化的功能:

private void FaceReader_FrameArrived(object sender, HighDefinitionFaceFrameArrivedEventArgs e)
{
    NewRecording();

    using (var frame = e.FrameReference.AcquireFrame())
    {
        if (frame != null)
        {
            frame.GetAndRefreshFaceAlignmentResult(_faceAlignment);
            UpdateFacePoints();

            var vertices = _faceModel.CalculateVerticesForAlignment(_faceAlignment);

            var lipLeftCorner = vertices[(int)HighDetailFacePoints.MouthLeftcorner];
            var lipRightCorner = vertices[(int)HighDetailFacePoints.MouthRightcorner];
            var lipWidth = Math.Abs(lipRightCorner.X - lipLeftCorner.X);
            var lipTopCorner = vertices[(int)HighDetailFacePoints.MouthUpperlipMidtop];
            var lipBottomCorner = vertices[(int)HighDetailFacePoints.MouthLowerlipMidbottom];
            var lipHeight = Math.Abs(lipTopCorner.Y - lipBottomCorner.Y);
            var chinCenter = vertices[(int)HighDetailFacePoints.ChinCenter];

            Console.WriteLine(lipLeftCorner.X.ToString());
            Console.WriteLine(lipRightCorner.X.ToString());
            Console.WriteLine(lipWidth.ToString());
            Console.WriteLine(lipTopCorner.Y.ToString());
            Console.WriteLine(lipBottomCorner.Y.ToString());
            Console.WriteLine(lipHeight.ToString());
            Console.WriteLine(lipTopCorner.Z.ToString());
            Console.WriteLine(chinCenter.X.ToString());
            Console.WriteLine(chinCenter.Y.ToString());
        }
    }
}

0 个答案:

没有答案