C# 无法使ZXing使用Kinect ColorFrame

C# 无法使ZXing使用Kinect ColorFrame,c#,kinect,zxing,C#,Kinect,Zxing,我能够使用ZXing解码Kinect保存的图像: // create a barcode reader instance IBarcodeReader reader = new BarcodeReader(); // load a bitmap Bitmap barcodeBitmap = (Bitmap)Bitmap.FromFile(path); // detect and decode the barcode inside the bitmap var result = reader.De

我能够使用ZXing解码Kinect保存的图像:

// create a barcode reader instance
IBarcodeReader reader = new BarcodeReader();
// load a bitmap
Bitmap barcodeBitmap = (Bitmap)Bitmap.FromFile(path);
// detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
其中
path
是由Kinect SDK示例代码生成的
.png
文件。它是在截图后执行的,速度很快,不到1秒

但是,当我尝试在没有任何文件的情况下执行相同的操作时:

FrameDescription colorFrameDescription = colorFrame.FrameDescription;
byte[] bit = new byte[colorFrameDescription.LengthInPixels * 4];
colorFrame.CopyConvertedFrameDataToArray(bit, ColorImageFormat.Bgra);
RGBLuminanceSource ls = new RGBLuminanceSource(bit, colorFrameDescription.Width, colorFrameDescription.Height);
IBarcodeReader reader = new BarcodeReader()  { AutoRotate = true, TryHarder = true } ;
// detect and decode the barcode inside the bitmap
var result = reader.Decode(ls); 

节目冻结了,没有播放任何节目。在调试模式下,我发现程序总是在
reader.Decode()
中,并且从未逃脱。有人知道这里一定出了什么问题吗?

您能提供数组“位”的转储吗?顺便说一句,ZXing.Net提供了一个专门的条形码阅读器,它包含在程序集ZXing.kinect.dll中。该读取器直接处理ColorImageFrame对象。能否提供数组“位”的转储?顺便说一句,ZXing.Net提供了一个专门的条形码阅读器,它包含在程序集ZXing.kinect.dll中。该读取器直接处理ColorImageFrame对象。能否提供数组“位”的转储?顺便说一句,ZXing.Net提供了一个专门的条形码阅读器,它包含在程序集ZXing.kinect.dll中。该阅读器直接处理ColorImageFrame对象。