Unable to read white on black Data Matrix barcode

5.7k views Asked by At

Data Matrix barcode support was added to iOS 8 and I'm able to use it to read Data Matrix barcodes if they are black on white (dark on light). However, it never reads a white on black (light on dark) barcode.

Reads this fine:

enter image description here

Unable to read this:

enter image description here

Per Data Matrix ECC 200, light on dark should be supported.

Anyone have an idea how to get iOS 8 to read a light on dark Data Matrix barcode?

1

There are 1 answers

7
Ryan Kreager On

You can invert the colors of your AVCaptureSession in real time, allowing you to read the Data Matrix code.

You can use GPUImage to invert the colors. It's fast and plugs in easily. Just invert and let AVFoundation find it as normal.