Bar Code reader for Corona - need beta test

ok

I’ll test it, it’s something I’m interested in

Hi Guys.

Just uploaded the beta version. Please get it at https://github.com/RedBeach/rb-reader

Let me know how it works for you as well as improvement suggestions.

Best,

Renato

Hi Renato, 

This is very very impressive!!! I built it and ran it on my iPhone4 and can confirm that it works well. I found that I was having trouble with smaller barcodes. I think the idea is that I need to get close to them so that the barcode fills most of the read window. When you do this with smaller barcodes the iPhone4 camera can’t zoom in. Not sure how the newer phones fare in this department. I tried staying far to keep barcode in focus and then used the size adjuster but did not get as good results as I did with larger barcodes filling the whole read window. 

I look forward to seeing how far you will take this. QR would be terrific.! Thanks for all your hard work. 

Regards,

Kerem

Hi Kerem.

Thanks for the feedback. Yes, having the phone to close to the bar code makes the camera to lose focus and since it has no way to force the camera to focus using Corona (at least as far as I know), you don’t have much options…

You can try increaste the “readCout” variable that you can adjust on the “+/-” buttons. It makes the code read several times at once on different vertical positions. Those reads are then merged, improving the accuracy. But of course, it takes longer to process…

Hi Renato, 

Thanks much for the idea. I will try the read count. In order to deal with the zoom / focus issue, do you think it might be possible to crop the image and scale it up to fill the read window once the read button is pressed? I’m thinking the read size adjuster could be used to define a crop window. This way I can stay back and in focus, adjust the read size to cover the barcode with a little extra on the sides and hit Read. the lib then crops the image, scales it up and then performs read. Maybe this will improve accuracy. Just an idea. 

Either way, this is nothing short of marvellous. All this time barcode reading was claimed to be only possible with the Enterprise license and access to native libraries and you proved this belief to be wrong. Kudos to you for this achievement. 

Regards,

Kerem

Hi Kerem.

Indeed, that is a very good ideia (to scale the image). The only “problem” is that it would be visible to the user, making it not very beautiful… But is definitively a way… I will it add as another improvement to be made.

That bar code was not possible with Corona because we weren’t able to read the pixel on the screen, but now we have the display.colorSample function, making the reader possible. That function has the limitation of only reading the pixels visible on the screen, what reduces the possibility of making the read, image zoom or other image manipulation without the user seeing it.

Another thing that I want to try is to test the usage of filter to improve the read accuracy (like, if I had a filter that makes the image black&white it would reduce a lot the reading errors). But, that will end in the same problem of your suggestion… the user would see the filter being applied.

Hi Renato,

Great job on this implementation! For the filter feature, you may want to consider combining a “grayscale” + “contrast” filter into a multi-pass filter to make the barcode black and white with higher contrast. Here are some links to relevant info:

http://coronalabs.com/blog/2013/10/17/tutorial-multi-pass-shaders-in-graphics-2-0/

http://docs.coronalabs.com/guide/graphics/effects.html

Best regards,

Brent

Nice suggestion of combining two filters. I didn’t know that I could do that. I will test that.

Thanks Brent.

Wow, very cool Renato!

I’ll test it and let you know. Thanks

Very neat job indeed. The request  for barcode support in Corona has been in the ‘request list’ for sometime (i did vote for it too). Would be great if Corona could include this as a plugin.

Please see: http://forums.coronalabs.com/topic/47210-contrast-filter-on-multi-pass-effects-doesnt-work/

Very impressive work, Indeed ! 

Very impressive work, Indeed ! 

Hey, this is awesome. I’m using it and modified the interface a bit for my needs. However, did you add any support for different types of barcodes? Maybe you can share some knowledge on what’s required for the code to support more barcode types?

Thanks!

This is awesome, I’ve been wishing for this for years! Can’t wait to try it out - 

Hi @yury.lankovskiy.

I didn’t add any new bar code support because I wanted to release a bar code plugin for Corona (which would have the support to several bar codes and have a much better improved performance) in the same as a Gremlin did for Chartboost, but Corona didn’t show so much interest on it.

In fact, I moving my business apps away from Corona due to these lack of basic features support. So, I am not foreseeing any update on that bar code reader code. But it is open source, you are free to fork it and extend its support.

Thanks for the reply!

I’ll look into extending this app.

One question is did anyone test on Android 4.2.2? I’ve built the app and testing it on Lenovo tablet however the camera view comes up as a white background, anyone has any idea?

Thanks!

The Corona camera feed is not supported on Android.

What you can do is take a photo using the photo Media API and then, when the user get backs to the app, run the lib.