LivotovLabs / CamView

[RETIRED ] Android camera easy access library and embedded QR (and other codes) scanner, based on ZXing
Apache License 2.0
174 stars 41 forks source link

CameraLiveView whats the use? #25

Open donpironet opened 8 years ago

donpironet commented 8 years ago

Whats the use of CameraLiveView class? Is it just to show the camera because you can't listen for QR codes or whats the difference?

I use the ScannerLiveView good job btw.

livotov commented 8 years ago

CameraLiveView is the base class, yes, it just shows the live stream from the camera on your activity/view without any effort. You can also grab frames and do some realtime postprocessing, if you want. This is because camera usage is not only about scanning barcodes.

ScannerLiveView is just an addon above the CameraLiveView. It uses CameraLiveView and its frame grabbing api to perform barcodes recognition.

So if you need barcodes only - use ScannerLiveView, if you need camera for smth else - CameraLiveView would be a good starting point.

donpironet commented 8 years ago

Oke thanks :-). I've one question though. I'm using this with the frontend camera and the scanning works but it's a bit slow vs the zxing app in the store. Do I need to do something special to just focus for QR codes or I don't know?

livotov commented 8 years ago

yep, CamView captures entire image instead of part of it like in zxing, this may result in slower processing. Current dev branch already contains an option to define a reduced area (when necessary), but the code is not yet synced to master. Probably I'll finish that task and sync it coming weekend, but cannot be 100% sure for now

donpironet commented 8 years ago

aa oké :-) but I'm using it in a production app that is used by 20 000 people so I have to implement something fast. Is there no version before 2.0.0 that is fast?

livotov commented 8 years ago

will push today some current work into the master here, with the api to change capture frame. WIll note the api usage here once pushed

livotov commented 8 years ago

Just pushed and also updated maven with the DEV8 snapshot. You can now reduce scanner area by providing a percent value from 0.1 (10%) to 1.0 (100%), see the bundled demo app onResume method of the MainActivity

@Override
    protected void onResume()
    {
        super.onResume();
        ZXDecoder decoder = new ZXDecoder();
        decoder.setScanAreaPercent(0.5);
        camera.setDecoder(decoder);
        camera.startScanner();
    }
donpironet commented 8 years ago

Thank you. Is it best to only scan 50%?

livotov commented 8 years ago

That depends on your usage scenario and on mobile devices used, I suppose. I personally prefer to use full screen scanning.

livotov commented 8 years ago

you can also speed up barcodes recognition by implementing custom decoder, based on ZBar sdk, as it is native code and works much faster on a full frame in comparison to zxing (at least it feels so for me)

I did not include zbar implementation into this library as it depends on a set of native libs and the license is not compatible either.