0

I've searched all the forum and I cannot find the answer (and this is my first post, so sorry for possible errors).

I've downloaded Zxing pack and I would like to get the qr code decoder work (in c#, a WPF application). The problem is that I get no error while compiling, and the application goes well (I take the input stream from kinect rgb camera) but it seems it does nothing.

I report some code (probably I've made some error...):

 RGBLuminanceSource ls = new RGBLuminanceSource(bit, frame.Width,frame.Height);
 Result result = new QRCodeReader().decode(new BinaryBitmap(new HybridBinarizer(ls)));
 if (result != null)
      Console.WriteLine("yahoo!");
 else
      Console.WriteLine("oh no");

with frame that is the frame captured by the kinect, and bit is the byte[] array that RGBLuminanceSource want as input, and I've made it by this:

byte[] bit= new byte[frame.PixelDataLength];
colorFrame.CopyPixelDataTo(bit);

What pass is that, when I put the paper with the qr code in front of the camera, it always return me the message "oh no", and I cannot figure out what I'm doing wrong.

4

2 回答 2

1

据我所知,您从 kinect 相机获得的图像是翻转的。您必须在解码之前将其翻转回来。您可以在此处找到更多详细信息:http: //zxingnet.codeplex.com/discussions/401772

于 2013-03-22T19:57:36.377 回答
0

如果有人偶然发现这个问题,您可以检查的东西很少。

  1. 从 ZXing git 下载 QRCodeDecoder 示例并准备就绪

  2. 将您的位图文件保存到文件夹位置。

  3. 从 QRCodeDecoder 检查保存的图像是否正确解码。

如果您通过网络摄像头或其他视频源将其用于 QR 码扫描仪,请检查您是否将位图图像转换为正确的像素格式。

希望这可以帮助

于 2019-07-30T10:42:08.133 回答