Feb 18, 2018 Replies: 46 Better solution: https://www.b4x.com/android/forum/threads/160725/#content This is not really a library. It is a modification to CameraEx example that adds barcode detection based on Google Play Services Vision. It uses JavaObject to create the detector and detect barcodes in the Preview event. You should call CreateDetector with the formats you want to detect. Fewer codes will yield faster detections. List of formats is available here: https://developers.google.com/andro...d/gms/vision/barcode/Barcode#constant-summary The implementation is quite simplistic as it is done on the main thread. It works good on Nexus 5X. I haven't tested it on low end devices. Note that you should add this code to the manifest editor: Code: <meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode" /> Attachments BarcodeCamera.zip BarcodeCamera.zip 13.6 KB · Views: 3,607 Last edited: Jul 18, 2024 Click to expand...
Better solution: https://www.b4x.com/android/forum/threads/160725/#content This is not really a library. It is a modification to CameraEx example that adds barcode detection based on Google Play Services Vision. It uses JavaObject to create the detector and detect barcodes in the Preview event. You should call CreateDetector with the formats you want to detect. Fewer codes will yield faster detections. List of formats is available here: https://developers.google.com/andro...d/gms/vision/barcode/Barcode#constant-summary The implementation is quite simplistic as it is done on the main thread. It works good on Nexus 5X. I haven't tested it on low end devices. Note that you should add this code to the manifest editor: Code: <meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode" />
Eme Fibonacci Well-Known Member Licensed User Longtime User Oct 1, 2018 #41 Great results. Thank you Erel.
Gandalf Member Licensed User Longtime User Oct 5, 2018 #42 Erel said: New version was uploaded. The detected rectangle is drawn. I've locked the orientation to landscape to make it simpler. Click to expand... If I set the orientation to portrait, detected rectangle gets incorrect coordinates. Can you please give me a hint how to fix it?
Erel said: New version was uploaded. The detected rectangle is drawn. I've locked the orientation to landscape to make it simpler. Click to expand... If I set the orientation to portrait, detected rectangle gets incorrect coordinates. Can you please give me a hint how to fix it?
Erel B4X founder Staff member Licensed User Longtime User Oct 7, 2018 #43 Start with this: Code: If 100%x < 100%y Then r.Initialize(100%x - br.GetField("y"),tl.GetField("x") , 100%x - tl.GetField("y"), br.GetField("x")) Log(r) Else 'landscape r.Initialize(tl.GetField("x"), tl.GetField("y"), br.GetField("x"), br.GetField("y")) End If
Start with this: Code: If 100%x < 100%y Then r.Initialize(100%x - br.GetField("y"),tl.GetField("x") , 100%x - tl.GetField("y"), br.GetField("x")) Log(r) Else 'landscape r.Initialize(tl.GetField("x"), tl.GetField("y"), br.GetField("x"), br.GetField("y")) End If
figorra Member Licensed User Longtime User Dec 21, 2018 #44 Erel said: Start with this: Code: If 100%x < 100%y Then r.Initialize(100%x - br.GetField("y"),tl.GetField("x") , 100%x - tl.GetField("y"), br.GetField("x")) Log(r) Else 'landscape r.Initialize(tl.GetField("x"), tl.GetField("y"), br.GetField("x"), br.GetField("y")) End If Click to expand... Where?
Erel said: Start with this: Code: If 100%x < 100%y Then r.Initialize(100%x - br.GetField("y"),tl.GetField("x") , 100%x - tl.GetField("y"), br.GetField("x")) Log(r) Else 'landscape r.Initialize(tl.GetField("x"), tl.GetField("y"), br.GetField("x"), br.GetField("y")) End If Click to expand... Where?
Erel B4X founder Staff member Licensed User Longtime User Dec 23, 2018 #45 Please start a new thread in the questions forum.
Erel B4X founder Staff member Licensed User Longtime User Aug 27, 2019 #46 I've updated the example. It fixes the issue with the red rectangle position.
Erel B4X founder Staff member Licensed User Longtime User Sep 1, 2019 #47 Example updated with support for portrait mode.