Hello itatanong ko lang po nag dedevelop po kase kame ng system na gesture recognition gamit po ang kinect sa c# WPF po namin ngayon ko lnag po kase naencounter to alam nyo po ba kung paano po ito ifix?
private readonly string gestureDatabase = @"Database/StopTheClock.gbd";
private readonly string seatedGestureName = "TaasKamay";
private VisualGestureBuilderFrameSource vgbFrameSource = null;
private VisualGestureBuilderFrameReader vgbFrameReader = null;
public GestureDetector(KinectSensor kinectSensor, GestureResultView gestureResultView)
{
if (kinectSensor == null)
{
throw new ArgumentNullException("kinectSensor");
}
if (gestureResultView == null)
{
throw new ArgumentNullException("gestureResultView");
}
this.GestureResultView = gestureResultView;
this.vgbFrameSource = new VisualGestureBuilderFrameSource(kinectSensor, 0);
this.vgbFrameSource.TrackingIdLost += this.Source_TrackingIdLost;
this.vgbFrameReader = this.vgbFrameSource.OpenReader();
if (this.vgbFrameReader != null)
{
this.vgbFrameReader.IsPaused = true;
this.vgbFrameReader.FrameArrived += this.Reader_GestureFrameArrived;
}
using (VisualGestureBuilderDatabase database = new VisualGestureBuilderDatabase(this.gestureDatabase))
{
foreach (Gesture gesture in database.AvailableGestures)
{
if (gesture.Name.Equals(this.seatedGestureName))
{
this.vgbFrameSource.AddGesture(gesture);
Debug.WriteLine($"Gesture '{gesture.Name}' loaded successfully.");
}
}
}
}
pag nirun ko po yung code ang lumalabas po ay
System.InvalidOperationException: 'This API has returned an exception from an HRESULT: 0x80004005'
COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
paano po kaya ito ayusin salamat po
private readonly string gestureDatabase = @"Database/StopTheClock.gbd";
private readonly string seatedGestureName = "TaasKamay";
private VisualGestureBuilderFrameSource vgbFrameSource = null;
private VisualGestureBuilderFrameReader vgbFrameReader = null;
public GestureDetector(KinectSensor kinectSensor, GestureResultView gestureResultView)
{
if (kinectSensor == null)
{
throw new ArgumentNullException("kinectSensor");
}
if (gestureResultView == null)
{
throw new ArgumentNullException("gestureResultView");
}
this.GestureResultView = gestureResultView;
this.vgbFrameSource = new VisualGestureBuilderFrameSource(kinectSensor, 0);
this.vgbFrameSource.TrackingIdLost += this.Source_TrackingIdLost;
this.vgbFrameReader = this.vgbFrameSource.OpenReader();
if (this.vgbFrameReader != null)
{
this.vgbFrameReader.IsPaused = true;
this.vgbFrameReader.FrameArrived += this.Reader_GestureFrameArrived;
}
using (VisualGestureBuilderDatabase database = new VisualGestureBuilderDatabase(this.gestureDatabase))
{
foreach (Gesture gesture in database.AvailableGestures)
{
if (gesture.Name.Equals(this.seatedGestureName))
{
this.vgbFrameSource.AddGesture(gesture);
Debug.WriteLine($"Gesture '{gesture.Name}' loaded successfully.");
}
}
}
}
pag nirun ko po yung code ang lumalabas po ay
System.InvalidOperationException: 'This API has returned an exception from an HRESULT: 0x80004005'
COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
paano po kaya ito ayusin salamat po