<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi Colleen, in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/QueryFaceAverageDepth/m-p/1054945#M51414</link>
    <description>&lt;P&gt;Hi Colleen,&lt;/P&gt;

&lt;P&gt;Thanks for your reply.&lt;/P&gt;

&lt;P&gt;In one of the samples (DF_FaceTracking) you have a class called "FaceTextOrganiser" where work is being done to create a detection window I believe. In the last method "ChangeFace", you have this:&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;PXCMFaceData.DetectionData fdetectionData = face.QueryDetection();&lt;/PRE&gt;

&lt;P&gt;So at the end of the method after verifying that fdetectionData is not null, I am calling the QueryFaceAverageDepth method with a float param just as your snippet shows - I get no errors, but this value is always 0.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
    <pubDate>Thu, 02 Apr 2015 22:30:36 GMT</pubDate>
    <dc:creator>Brennon_W_</dc:creator>
    <dc:date>2015-04-02T22:30:36Z</dc:date>
    <item>
      <title>QueryFaceAverageDepth</title>
      <link>https://community.intel.com/t5/Software-Archive/QueryFaceAverageDepth/m-p/1054943#M51412</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;In C# parsing a float as the out param of QueryFaceAverageDepth never return a value.&lt;/P&gt;

&lt;P&gt;Is this a known issue?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2015 19:00:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/QueryFaceAverageDepth/m-p/1054943#M51412</guid>
      <dc:creator>Brennon_W_</dc:creator>
      <dc:date>2015-03-17T19:00:41Z</dc:date>
    </item>
    <item>
      <title>We tested this and had no</title>
      <link>https://community.intel.com/t5/Software-Archive/QueryFaceAverageDepth/m-p/1054944#M51413</link>
      <description>&lt;P&gt;We tested this and had no issue. &amp;nbsp;Here's the relevant snips of code....let me know if you'd like the whole code by pm.&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;expressionConfiguration;&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;float faceAverageDepth;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;......&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp; &amp;nbsp;// Retrieve face related data&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp;PXCMFaceData.DetectionData&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;faceDetectionData = faceDataFace.QueryDetection();&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp; if (faceDetectionData != null)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;{&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PXCMRectI32 faceRectangle;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;faceDetectionData.QueryFaceAverageDepth(out faceAverageDepth);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;
	.................................................&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate()&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lblFaceDepth.Content = string.Format("Face Average Depth: {0}", faceAverageDepth);&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2015 22:17:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/QueryFaceAverageDepth/m-p/1054944#M51413</guid>
      <dc:creator>Colleen_C_Intel</dc:creator>
      <dc:date>2015-04-02T22:17:10Z</dc:date>
    </item>
    <item>
      <title>Hi Colleen,</title>
      <link>https://community.intel.com/t5/Software-Archive/QueryFaceAverageDepth/m-p/1054945#M51414</link>
      <description>&lt;P&gt;Hi Colleen,&lt;/P&gt;

&lt;P&gt;Thanks for your reply.&lt;/P&gt;

&lt;P&gt;In one of the samples (DF_FaceTracking) you have a class called "FaceTextOrganiser" where work is being done to create a detection window I believe. In the last method "ChangeFace", you have this:&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;PXCMFaceData.DetectionData fdetectionData = face.QueryDetection();&lt;/PRE&gt;

&lt;P&gt;So at the end of the method after verifying that fdetectionData is not null, I am calling the QueryFaceAverageDepth method with a float param just as your snippet shows - I get no errors, but this value is always 0.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2015 22:30:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/QueryFaceAverageDepth/m-p/1054945#M51414</guid>
      <dc:creator>Brennon_W_</dc:creator>
      <dc:date>2015-04-02T22:30:36Z</dc:date>
    </item>
    <item>
      <title>MainWindow.xaml.cs</title>
      <link>https://community.intel.com/t5/Software-Archive/QueryFaceAverageDepth/m-p/1054946#M51415</link>
      <description>&lt;PRE class="brush:css;"&gt;MainWindow.xaml.cs

//--------------------------------------------------------------------------------------
// Copyright 2015 Intel Corporation
// All Rights Reserved
//
// Permission is granted to use, copy, distribute and prepare derivative works of this
// software for any purpose and without fee, provided, that the above copyright notice
// and this statement appear in all copies.  Intel makes no representations about the
// suitability of this software for any purpose.  THIS SOFTWARE IS PROVIDED "AS IS."
// INTEL SPECIFICALLY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, AND ALL LIABILITY,
// INCLUDING CONSEQUENTIAL AND OTHER INDIRECT DAMAGES, FOR THE USE OF THIS SOFTWARE,
// INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PROPRIETARY RIGHTS, AND INCLUDING THE
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  Intel does not
// assume any responsibility for any errors which may appear in this software nor any
// responsibility to update it.
//--------------------------------------------------------------------------------------
using System;
using System.Windows;
using System.Threading;

namespace FaceTrackingSample
{
    /// &amp;lt;summary&amp;gt;
    /// Interaction logic for MainWindow.xaml
    /// &amp;lt;/summary&amp;gt;
    public partial class MainWindow : Window
    {
        private Thread processingThread;
        private PXCMSenseManager senseManager;
        private PXCMSession session;
        private PXCMFaceModule face;
        private PXCMFaceConfiguration faceConfiguration;
        private PXCMFaceConfiguration.ExpressionsConfiguration expressionConfiguration;
        private Int32 numberTrackedFaces;
        private int faceRectangleHeight;
        private int faceRectangleWidth;
        private int faceRectangleX;
        private int faceRectangleY;
        private float faceAverageDepth;
        private float headRoll;
        private float headPitch;
        private float headYaw;
        private int smileScore;

        public MainWindow()
        {
            InitializeComponent();
            senseManager = PXCMSenseManager.CreateInstance();
            session = senseManager.QuerySession();
            senseManager.EnableFace();
            senseManager.Init();
            ConfigureFaceTracking();
            processingThread = new Thread(new ThreadStart(ProcessingThread));
            processingThread.Start();
        }

        private void ConfigureFaceTracking()
        {
            face = senseManager.QueryFace();
            faceConfiguration = face.CreateActiveConfiguration();
            faceConfiguration.detection.isEnabled = true;

            expressionConfiguration = faceConfiguration.QueryExpressions();
            expressionConfiguration.Enable();
            expressionConfiguration.EnableAllExpressions();

            faceConfiguration.EnableAllAlerts();
            faceConfiguration.ApplyChanges();
        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            processingThread.Abort();
            faceConfiguration.Dispose();
            senseManager.Dispose();
        }

        private void ProcessingThread()
        {
            // Start AcquireFrame/ReleaseFrame loop
            while (senseManager.AcquireFrame(true) &amp;gt;= pxcmStatus.PXCM_STATUS_NO_ERROR)
            {
                // Get a face instance
                face = senseManager.QueryFace();

                if (face != null)
              {
                    // Get face tracking processed data
                    PXCMFaceData faceData = face.CreateOutput();
                    faceData.Update();
                    numberTrackedFaces = faceData.QueryNumberOfDetectedFaces();

                    // Retrive the face location data instance
                    PXCMFaceData.Face faceDataFace = faceData.QueryFaceByIndex(0);
                    
                    if (faceDataFace != null)
                    {
                        // Retrieve face location data
                        PXCMFaceData.DetectionData faceDetectionData = faceDataFace.QueryDetection();
                        if (faceDetectionData != null)
                        {
                            PXCMRectI32 faceRectangle;
                            faceDetectionData.QueryFaceAverageDepth(out faceAverageDepth);
                            faceDetectionData.QueryBoundingRect(out faceRectangle);
                            faceRectangleHeight = faceRectangle.h;
                            faceRectangleWidth = faceRectangle.w;
                            faceRectangleX = faceRectangle.x;
                            faceRectangleY = faceRectangle.y;
                        }

                        // Retrive pose estimation data
                        PXCMFaceData.PoseData facePoseData = faceDataFace.QueryPose();
                        if (facePoseData != null)
                        {
                            PXCMFaceData.PoseEulerAngles headAngles;
                            facePoseData.QueryPoseAngles(out headAngles);
                            headRoll = headAngles.roll;
                            headPitch = headAngles.pitch;
                            headYaw = headAngles.yaw;
                        }

                        // Retrieve expression data
                        PXCMFaceData.ExpressionsData expressionData = faceDataFace.QueryExpressions();
                        if (expressionData != null)
                        {
                            PXCMFaceData.ExpressionsData.FaceExpressionResult score;
                            expressionData.QueryExpression(PXCMFaceData.ExpressionsData.FaceExpression.EXPRESSION_SMILE, out score);
                            smileScore = score.intensity;
                        }
                    }

                    UpdateUI();
                    faceData.Dispose();
                }

                senseManager.ReleaseFrame();
            }
        }

        private void UpdateUI()
        {
            this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate()
            {
                lblNumberFaces.Content = string.Format("Detected Faces: {0}", numberTrackedFaces);
                lblFaceH.Content = string.Format("Face Height: {0}", faceRectangleHeight);
                lblFaceW.Content = string.Format("Face Width: {0}", faceRectangleWidth);
                lblFaceX.Content = string.Format("Face X: {0}", faceRectangleX);
                lblFaceY.Content = string.Format("Face Y: {0}", faceRectangleY);
                lblFaceDepth.Content = string.Format("Face Average Depth: {0}", faceAverageDepth);
                lblHeadRoll.Content = string.Format("Head Roll: {0}", headRoll);
                lblHeadPitch.Content = string.Format("Head Pitch: {0}", headPitch);
                lblHeadYaw.Content = string.Format("Head Yaw: {0}", headYaw);
                lblExpression.Content = string.Format("Smile Score: {0}", smileScore);
            }));
        }
    }
}

MainWindow.xaml

&amp;lt;Window x:Class="FaceTrackingSample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Face Tracking Sample" Height="452.287" Width="452.219" Icon="icon.ico" Closing="Window_Closing" WindowStartupLocation="CenterScreen"&amp;gt;

    &amp;lt;StackPanel&amp;gt;
        &amp;lt;Label x:Name="lblNumberFaces" Content="-" FontSize="16" Margin="30,4,0,4"/&amp;gt;
        &amp;lt;Label x:Name="lblFaceH" Content="-" FontSize="16" Margin="30,4,0,4"/&amp;gt;
        &amp;lt;Label x:Name="lblFaceW" Content="-" FontSize="16" Margin="30,4,0,4"/&amp;gt;
        &amp;lt;Label x:Name="lblFaceX" Content="-" FontSize="16" Margin="30,4,0,4"/&amp;gt;
        &amp;lt;Label x:Name="lblFaceY" Content="-" FontSize="16" Margin="30,4,0,4"/&amp;gt;
        &amp;lt;Label x:Name="lblFaceDepth" Content="-" FontSize="16" Margin="30,4,0,4"/&amp;gt;
        &amp;lt;Label x:Name="lblHeadRoll" Content="-" FontSize="16" Margin="30,4,0,4"/&amp;gt;
        &amp;lt;Label x:Name="lblHeadPitch" Content="-" FontSize="16" Margin="30,4,0,4"/&amp;gt;
        &amp;lt;Label x:Name="lblHeadYaw" Content="-" FontSize="16" Margin="30,4,0,4"/&amp;gt;
        &amp;lt;Label x:Name="lblExpression" Content="-" FontSize="16" Margin="30,4,0,4"/&amp;gt;
    &amp;lt;/StackPanel&amp;gt;
&amp;lt;/Window&amp;gt;
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2015 00:49:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/QueryFaceAverageDepth/m-p/1054946#M51415</guid>
      <dc:creator>Colleen_C_Intel</dc:creator>
      <dc:date>2015-04-03T00:49:54Z</dc:date>
    </item>
    <item>
      <title>Hi Colleen,</title>
      <link>https://community.intel.com/t5/Software-Archive/QueryFaceAverageDepth/m-p/1054947#M51416</link>
      <description>&lt;P&gt;Hi Colleen,&lt;/P&gt;

&lt;P&gt;Thanks for the sample.&lt;/P&gt;

&lt;P&gt;I'm still no clearer as to why the implementation that is in the Sample SDK does not work, when really it should.&lt;/P&gt;

&lt;P&gt;Will keep messing around and update if I figure it out.&lt;/P&gt;

&lt;P&gt;Thanks again for the help.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2015 10:11:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/QueryFaceAverageDepth/m-p/1054947#M51416</guid>
      <dc:creator>Brennon_W_</dc:creator>
      <dc:date>2015-04-08T10:11:45Z</dc:date>
    </item>
    <item>
      <title>I was running into this same</title>
      <link>https://community.intel.com/t5/Software-Archive/QueryFaceAverageDepth/m-p/1054948#M51417</link>
      <description>&lt;P&gt;I was running into this same issue for a bit, but managed to figure it out the reason why I was seeing the problem.&lt;/P&gt;

&lt;P&gt;The QueryFaceAverageDepth is a boolean function that will return False if it doesn't set your out parameter, so that's the first thing to check.&lt;/P&gt;

&lt;P&gt;I was seeing the function itself return false, and my out parameter stayed at whatever I set it to initially.&lt;/P&gt;

&lt;P&gt;Eventually I stumbled upon this line of code:&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;PXCMFaceConfiguration.TrackingModeType mode = PXCMFaceConfiguration.TrackingModeType.FACE_MODE_COLOR;&lt;/PRE&gt;

&lt;P&gt;From looking at some sample code, I noticed they had this:&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;PXCMFaceConfiguration.TrackingModeType mode = PXCMFaceConfiguration.TrackingModeType.FACE_MODE_COLOR_PLUS_DEPTH;&lt;/PRE&gt;

&lt;P&gt;Changing it to PLUS_DEPTH seemed to fix the issue for me.&lt;/P&gt;

&lt;P&gt;Hopefully this helps anyone else that might run into the same issue in the future, or at least eliminate a potential cause of this problem.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Aug 2015 00:07:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/QueryFaceAverageDepth/m-p/1054948#M51417</guid>
      <dc:creator>Zenny_T_</dc:creator>
      <dc:date>2015-08-01T00:07:51Z</dc:date>
    </item>
  </channel>
</rss>

