Hi Sean,
Thanks for your quick and thoughtful reply.
One thing i think i didn't make clear before is that were not using an existing tablet, we've designed our own platform, from the ground up, around a popular processor found in many consumer Android devices.
Thus we don't have to live with the design compromises in consumer devices, we can tailor ours as we see fit.
Ditto if we decide to design our own board-level camera module for barcode scanning if it comes down to that, though i think we might be able to avoid the extra headache.
If necessary we can upgrade to a quad-core processor, but hopefully that wont be-
So as far as preview mode vs picture resolution, well, we get to choose what resolution is used in preview mode, or feed into zxing.
Image sensors under consideration can output the full 5mpixel (2592x1944) RAW images at 30fps. Or any scaled down version of that. Thus the questions about optimal image resolution for zxing -
I went ahead and did a few "back of the envelope" calculations today to try and figure out what is minimum or useful /recommended resolution to safely get a good scan of an imaged barcode every time:
Assuming: typical small printed barcode (linear) with a minimum element width ~ 0.2mm (measured) which gives a "DPI" of ~125 as printed;
multiply that by 2 = 250 (2 pixels per line/space min) average up to 300 for extra margin ;
Now our use case resembles a supermarket price verifier, sometimes seen mounted on the end of an isle or post in a large store. this is not a user-maneuvered, handheld device.
because of that and the large range of objects an codes we need to be able to capture, a generous scan area is mandated - perhaps 8" x 6" at peak focal distance, which will be ~ 30cm from the imager.
8" x 300 DPI = 2400 pixels wide. Thus it seems we actually need the 5MPixel imager to satisfy all requirements.
Now granted a smaller barcode can be moved in closer if there is autofocus or DOF allows, but i've seen barcodes 4-5" wide on large odd-shaped packages that would not allow that, so we try to design for worst-case conditions.
Given these atypical operating conditions, i'm trying to figure out how to best adapt zxing, if its even possible, to work in this scenario, and give reasonably fast, accurate, and reliable reads.
I guess the biggest unknown for me which can have a big impact here is, how to quantify the time it might take to process an image - which i imagine can vary a lot -
but its useful to get a ballpark number here to figure out what framerate can be supported that wont cause zxing to "give up" and switch to a new frame, if it could have found & read the barcode given more time -
and get a sense of what worst case latency might be.
For example - (discaimer: i havent dug into zxing internals, so i have no clue if this applies or not)
Say that on a typical VGA preview image, on a typical cheap 7" single-core tablet, zxing can scan the whole image and detect & decode 98% of barcodes in 30mS.
Maybe it does in a linear fashion, scanning top to bottom, left to right.
So in this case even at 30fps (33mS/frame), you get excellent results in general.
How does that scale to a full 5Mpix image stream ?
Assuming image throughput scales linearly with pixel count (which is probably wrong, it may be more exponential)
we have 16.4x the number of pixels compared to VGA. 16.4 * 30mS = 492mS, nearly 1/2 second. (my gut feeling is longer in reality)
If we feed this stream into zxing at 30fs, and it switches to a new frame the instant one is available, well i don't see how this could work.
Less than 1/10 of the frame would get scanned in the allotted time, and we'd have to be very lucky with the barcode size and position (within the frame) to get a good read.
So if this were true, it seems some other strategy or tricks would have to be applied - or combination of them, to get good results.
So the big question is,
Is there any way to roughly quantify how much time it takes to process an image? given one or more scenarios - of scan parameters (enabled barcode types, etc ), image size, actual barcode type, orientation and image quality ?
Thanks
Frantz