shirne / zxing-dart

zxing-dart is a Dart port of zxing.
Apache License 2.0
54 stars 10 forks source link

PDF 417 Decoding in Flutter Web #2

Closed BrayFlex closed 3 years ago

BrayFlex commented 3 years ago

Would you be able to make this work for Flutter Web, I've been trying to read PDF417 codes using a webcam and haven't had any luck with my own ports or using system channels with / js workarounds.

shirne commented 3 years ago

这个项目目前性能比java版差很多,我自己尝试的使用摄像头扫描时识别率也比较低。 The current performance of this project is much worse than that of the java version, and the recognition rate when I try to scan with the camera is also relatively low. 我正在想办法做一些优化。 I am thinking of ways to do some optimizations. Web端扫描PDF417格式的我抽空测试一下是识别率问题还是Bug。 Scanning the PDF417 format on the web side, I took the time to test whether it is a recognition rate problem or a bug .

JeffOlajos commented 3 years ago

I've tried this code via Flutter Web and tried decoding a simple file that contains a QR code but that doesn't seem to work??? Any ideas or is this pkg simply not working yet?

JeffOlajos commented 3 years ago
  if (img is ImageInfo)
  {
    ByteData data   = await img.image.toByteData(format: ImageByteFormat.rawRgba);
    bytes  = data.buffer.asUint8List();
    pixels = bytes.buffer.asInt32List();
    width  = img.image.width;
    height = img.image.height;
  }
  print ('image size (w,h) is (' + width.toString() + "," + height.toString() + ')');

 // bytes = Base64Codec().decode("iVBORw0KGgoAAAANSUhEUgAABLAAAASwCAQAAABBKHtEAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfkBQgJAzE5dzzdAAAeb0lEQVR42u3Zf5BeVX3H8e+aZ3eTkGwKsoAQhpZUgUUMDoTFjsTquKk6iKOotdHWJs4AjrW1LVKdNlSNOsowLbZVUzsYrRg61WhrtY7iz8WOJiguFYJUKTIGpGxIZPMDNiTZ/tXp3zufzJy9u6/X8/e5e865597nnTxVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgMb+Fwu38BZAZoGIAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTA1LTA4VDA5OjAzOjQ5KzAwOjAwPHWOxQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0wNS0wOFQwOTowMzo0OSswMDowME0oNnkAAAAASUVORK5CYII=");

  LuminanceSource source = RGBLuminanceSource(width, height, pixels);
  var bitmap = BinaryBitmap(HybridBinarizer(source));
shirne commented 3 years ago

@JeffOlajos

The RGBLuminanceSource needs a pixels param one element per pixel. The rawRgba data is a Uint8List store a pixel in 4 elements by red, green, blue, alpha. You can translate it like

int byte2Pixel(Uint8List byteData, int firstIndex){
    return byteData[firstIndex + 3] << 24 + byteData[firstIndex] << 16  + byteData[firstIndex+1] << 8 + byteData[firstIndex+2] ;
}

Can you give me a star before you fork it ^_^

JeffOlajos commented 3 years ago

Thanks. I’ll give that a try. I wasn’t even able to decode the same image file with your demo program. Our real challenge is pdf417

JeffOlajos commented 3 years ago

Great work btw. This will garner a lot of attention if done right. Are you planning on adding the code_39 _extended?

shirne commented 3 years ago

Great work btw. This will garner a lot of attention if done right. Are you planning on adding the code_39 _extended?

In fact, I don't know much about the types of barcodes. The codes here is completely translated according to the zxing-java version. What is the difference between code_39_extended and code_39? Is there any documentation on this? If it is not too much trouble, you can try it, but I am not sure yet.

shirne commented 3 years ago

Thanks. I’ll give that a try. I wasn’t even able to decode the same image file with your demo program. Our real challenge is pdf417

Regarding the pdf417 format, the Case in the test project has passed, but the decoding rate in actual use is relatively low, especially for the scanning of screen devices. I currently have no better way of this. Maybe some processing (such as homogenization or moiré removal) on the picture before decoding will have better results, but I am not good at this aspect.

shirne commented 3 years ago

@BrayFlex

Would you be able to make this work for Flutter Web, I've been trying to read PDF417 codes using a webcam and haven't had any luck with my own ports or using system channels with / js workarounds.

我尝试了下web端编码和解码工作,采用web接口调用摄像头的方案一直有问题,没有太好的解决办法。可以使用选择文件中的照相操作代替。 I tried the web-side encoding and decoding work. The solution of using the web interface to call the camera has always been problematic, and there is no good solution. You can use the camera operation in the selected file instead. 具体效果可以查看这个项目。这个issue我就先关掉了。 The specific effect can be viewed in this project. I will close this issue first. https://github.com/shirne/zxingweb