|
@@ -27,6 +27,7 @@ namespace bbiwarg.DataSource
|
|
|
private IDataHandle<int>[] handSides = new IDataHandle<int>[2];
|
|
|
private IDataHandle<Iisu.Data.IImageData> depthImage;
|
|
|
private IDataHandle<Iisu.Data.IImageData> colorImage;
|
|
|
+ private IDataHandle<Iisu.Data.IImageData> confidenceImage;
|
|
|
|
|
|
/*
|
|
|
* Creates an Iisu data source.
|
|
@@ -47,9 +48,9 @@ namespace bbiwarg.DataSource
|
|
|
IDeviceConfiguration conf = handle.CreateDeviceConfiguration();
|
|
|
if (moviePath.Length != 0)
|
|
|
conf.MoviePath = moviePath;
|
|
|
-
|
|
|
+
|
|
|
device = handle.InitializeDevice(conf);
|
|
|
-
|
|
|
+
|
|
|
// parameters
|
|
|
if (moviePath.Length != 0)
|
|
|
device.RegisterParameterHandle<int>("SOURCE.MOVIE.PlayMode").Value = 0; // playMode = once
|
|
@@ -60,8 +61,8 @@ namespace bbiwarg.DataSource
|
|
|
|
|
|
// data
|
|
|
depthImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.DEPTH.Image");
|
|
|
-
|
|
|
colorImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.COLOR.Image");
|
|
|
+ confidenceImage = device.RegisterDataHandle<Iisu.Data.IImageData>("SOURCE.CAMERA.CONFIDENCE.Image");
|
|
|
|
|
|
handOpen[0] = device.RegisterDataHandle<bool>("CI.HAND1.IsOpen");
|
|
|
handOpen[1] = device.RegisterDataHandle<bool>("CI.HAND2.IsOpen");
|
|
@@ -125,6 +126,8 @@ namespace bbiwarg.DataSource
|
|
|
|
|
|
public DepthImage getDepthImage()
|
|
|
{
|
|
|
+
|
|
|
+
|
|
|
Iisu.Data.IImageInfos imageInfos = depthImage.Value.ImageInfos;
|
|
|
int width = (int) imageInfos.Width;
|
|
|
int height = (int) imageInfos.Height;
|
|
@@ -153,6 +156,21 @@ namespace bbiwarg.DataSource
|
|
|
return new ColorImage(width, height, colorData);
|
|
|
}
|
|
|
|
|
|
+ public ConfidenceImage getConfidenceImage()
|
|
|
+ {
|
|
|
+ Iisu.Data.IImageInfos imageInfos = confidenceImage.Value.ImageInfos;
|
|
|
+ int width = (int)imageInfos.Width;
|
|
|
+ int height = (int)imageInfos.Height;
|
|
|
+ int numBytes = (int)imageInfos.BytesRaw;
|
|
|
+
|
|
|
+ IntPtr imageData = confidenceImage.Value.Raw;
|
|
|
+
|
|
|
+ short[] confidenceData = new short[width * height];
|
|
|
+ Marshal.Copy(imageData, confidenceData, 0, width * height);
|
|
|
+
|
|
|
+ return new ConfidenceImage(width, height, confidenceData);
|
|
|
+ }
|
|
|
+
|
|
|
private void checkHandIndex(uint handIndex)
|
|
|
{
|
|
|
if (handIndex < 1 || handIndex > 2)
|