AndroidアプリでZXingを利用してデータマトリックスをスキャンしようとしています。これまでのところ、私はこのような印刷されたデータマトリックスで成功しています:
しかし、レーザーで印刷された、またはパンチされた他のデータマトリックスには、正方形のマークではなく、円のマークがあります。
これらには問題があります。これをスキャンできると私が見つけた唯一のアプリはQRDroidです。この記事では、QRDroidはZXingを使用していると述べているので、可能であれば、方法があるはずだと思います。残念ながら、QRDroidはオープンソースプロジェクトではないので、方法がわかりません。
もちろん、QRDroidがアルゴリズムを使用して、データマトリックスを読み取ろうとする前に、丸で囲んだマークを四角いマークに変換している可能性があります。Javaでの画像操作については何も知らないので、これがどのように行われるか想像できません。
私の質問は、このタイプのデータマトリックスを読み取るためにZXingを微調整する方法があるかどうか、またはZXingで読み取り可能にするために画像を操作するために使用できるライブラリがあるかどうかです。
編集:
画像エディタを使用する場合(たとえば、https://www.befunky.comを使用して10のぼかしを適用する場合)、通常の印刷データマトリックスのように見え、スキャンは機能します。Androidアプリでこれを行うにはどうすればよいですか?
After some research I found out that this type of marking is not really considered a standard data matrix but rather referred to by the manufacturing industry as a DPM, which stands for "Direct Part Marking", although I've read other sources call it "Dot Peen Marking" or "Dot Peen Matrix"
I posted this same question on an already existing issue in the Zxing repository and this was the reply I got:
The problem is the
WhiteRectDetector
. It finds a white rectangle inside the code, similar to this issue. If you rotate the image slightly (say 10°) or you blur it as you did or you did a suitably sized pixel dilation followed by an erosion, you'll get something that should (mostly) be detectable.
Modifying the WhiteRectDetector
, to allow for dots rather than squares was not really an option for me due to deadlines, so I ended up switching from Zxing to Scandit, which is proven to be able to scan this.
Scanditはプロプライエタリライブラリですが、他の選択肢は実際には見つかりませんでした。ただし、トライアルライセンスを取得できます。DPMをスキャンするために試してみたい人のために、このシンボルのスキャンを有効にする方法についてのドキュメントはあまり明確ではないので、ここにトリックがあります。
Androidの場合:
settings.getSymbologySettings(Barcode.SYMBOLOGY_DATA_MATRIX)
.setExtensionEnabled("direct_part_marking_mode", true);
Objective-Cの場合:
[[settings settingsForSymbology:SBSSymbologyDatamatrix]
setExtension:@"direct_part_marking_mode" enabled:YES];
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加