zxing does not find readable barcode - zxing

I try to detect barcodes in webcam images and have problems to find small barcodes in a large image. xzing (svn trunk) fails to find the barcode in the first image (See links) even with try-harder. If I however manually crop the image (second image) it has no problem extracting the information. So it should also be possible to find the barcode in the first image.
Is there a way to tell xzing to also find smaller barcodes? Or is there already some sliding window implemented or maybe a gradient based barcode localizer?
Original: No barcode found
http://postimg.org/image/lh9xf7lw1/
Cropped Version: Barcode extracted
http://postimg.org/image/e1kb49tw1/

Try different binarizers. You are probably using the one that computes a histogram over the whole image. The varied brightness causes the barcode itself to be treated as more uniform patch of black. The hybrid binarizer is more localized and likely to get the same effect as cutting out the rest of the image manually.

In my case this tip helped
Android zxing NotFoundException
It suggests adding TRY_HARDER
Hashtable<DecodeHintType, Object> decodeHints = new Hashtable<>();
decodeHints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
result = reader.decode(bitmap, decodeHints);

Related

Remove image background(ID Card) and prepared it for OCR

I want to integrate OCR in an iOS application. I have found some helpful tutorials, specially This Article: How To: Compile and Use Tesseract (3.01) on iOS (SDK 5), helped me a lot. Now I can read plain text from any image which has a clear background. But I want to read information from an ID card which doesn't have clear background at all!
I have also found some answers regarding removing background in stackoverflow, for example: Prepare complex image for OCR, Remove Background Color or Texture Before OCR Processing and How to use OpenCV to remove non text areas from a business card?
But those solutions are not for iOS. I understand the steps, but I need an iOS example and if it is using Core Image, than it would be better for me.
I have no problem in OCR end, but my problem is to remove the background.
Initial Image:
After removing, the image should look like this:
Can you refer me an iOS example? or Is it possible to refer me an iOS example to remove all the color without Black color?
the best way to detect a card in sence is traing a cascade classifier.
Training is not a very small project. the count of the sample images should be more thank 10K.
Once you get the trained cascade classifier, you can detect the the card quickly.
The detection is very quick on iOS, but the tesseract recognition is not very fast,

iPhone OCR doesn't recognize all the captured images text, But can recognize the predefined Text images

I have implemented a business card reader image using ocr api by follow the link/ tutorial
http://tinsuke.wordpress.com/2011/11/01/how-to-compile-and-use-tesseract-3-01-on-ios-sdk-5/
It can scan the text of some screen shots of UIalert views / table views. and some images having text like follows.
Can recognize text on this image:
[Airoplane mode wi-fi vpn ratch data sounds brightness general wall paper]
but when i capture business card it returns some special charecters and numbers. some times recognized if it is very very clear and big text in captured image.
Can NOT recognize text on follow like images
[ xas $- 432 *7 5$#2 $###%^ ^&* I( WQ#$ follow like√ √dg # ]
why how to resolve this issue.
Tesseract library is open source library. I don't think it is that much accurate.OCR gives best results for image more than 150 px resolution with black and white image .The image which you are capture with the camera of iPad or iPhone is saved with 72px that tesseract cannot give best results.If you are more interested then there are some paid libraries with good accuracy you can try out some :here

How to give sketch effect on image in iphone?

I am implementing an iPhone application, in which I have implemented the following functionalities:
Select photo
Capture photo
Now I want to give a sketch effect to that photo like this one.
How could I do this?
If I may once again recommend it, my open source GPUImage framework has a built in filter that does just this. The GPUImageSketchFilter uses Sobel edge detection to highlight edges in black on images or video, leading to the exact same effect as seen in that application:
The above image was drawn from this answer, where I describe how that filter works, as well as show a couple other filter examples.
In fact, the SimplePhotoFilter example application that comes with the framework does exactly what you describe (capture a photo, apply a sketch filter to it, and save it to the photo library), so I'd start there if you want to get this up and running quickly.
OpenCV can be used to give sketch effect on image in iphone.
Refer iphone-how-to-convert-a-photo-into-a-pencil-drawing link and get helped.
Core Image filters are probably the best way to go.
http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CoreImageFilterReference/.

imagemagick monochrome convert in iPhone

I have an image in the iPhone that I need to convert to monochrome. The images are photographs of documents and I need as clean a conversion as I can get.
My first solution did a pixel for pixel compare with a threshold, and while it does the conversion fine, shadows can overwhelm the image.
My next trial is to use imagemagick, hoping that there are various noise reduction/despeckle filters that I can apply to clean the image up, which is what this guy is doing.
I have imagemagick running on the iPhone and can apply "MagickWand" methods with no problem. My issue is that I don't think there is one built in that will do what I want. So I turn to the ConvertImageCommand but am lost on how to actually use it.
So I am looking for any guidance or examples. Thanks!
It turns out what I've been looking for is Adaptive Thresholding in my conversion to monochrome.
Chris Greening has created an image processing library that handles this quite well.
So no imagemagick needed.

How to create facebook wall posts and add retina version of picture

We're using the facebook graph API http://developers.facebook.com/docs/reference/api/post/ and adding the picture parameter. Our picture is a 30x30 pixel image, which is exactly the size we want for the facebook web version. However, the image will be pixelated when using the FB mobile app on an iPhone4 (retina display).
Is there any way to serve a 60x60 high resolution image, but render it always at 30x30 for facebook wall posts?
Well.. as of this moment, here is what I have found out, and offer a 'solution' that has worked for me based on the time i've had to test & play with this concept. For all the readers out there, who need a quick answer to the question, i don't have the exact solution to the question, but…. Essentially, your 30x30 image is being scaled to 90x90. The 60x60 image is being scaled to 90x90. And I can not find a way to go around this.
Below is what I have tried. Feel free to add input.
Take your feed image, and stroke a 2-5px black line around the frame of the image.
Load up your app, initiate a wall feed on the device. With the image present, take a screenshot. Mail yourself the image. Open it up in Photoshop (or photo editing program). Use a Marquee tool to outline the image. Cut it out of the screenshot and paste it as a new image. What size is it? 90x90, right? (and obviously 180x180 if image is retina)
Create a 90x 90 image. Copy your original 30x30 image and paste it anywhere you want within the new 90x90 images' frame. Upload it to the URL parameter's location. Re-run your app. By re-running it, i mean you have to shut it down completely, it appears as though the SDK is cacheing the image upon first launch of the feed and you can clear that cache by closing the app completely, and rerunning it. When you do, you will see significant improvements with the look of the image. It may not be a retina image, but it at least won't be 'fuzzy ugly'. At this point, it boils down to how nice of illustrative lines that where done in the design process to remove the aliasing effect produced from the conversion to a raster graphic. As well, i'm not sure if a variation of resampling method will produce even better results.
Some things i've tried:
I've also saved it as a png file with no transparency : 144ppi at 90 x 90 size. In other words, save your 90x90 image with a higher resolution (pixels per inch). Remember to not constrain proportions as you image resize. And note that If you are using adobe products, i.e. photoshop ) - don't save for web, just use 'save as…', as this will retain the ppi you specified. Although, i don't believe i see much of a difference in the quality which this is displayed going this route, and best to try to keep the file size down as this will increase the overall image size by about 500% or more.
I've tried variations of hosting the image twice the size (180x180) within the same hosted folder and naming it image#2x.png & image-large.png <--(just for the heck of it). This is not really solving the problem either.
Some other things I have not tried:
Monitoring your web server traffic, and any "not found" errors to a resource to see if FB is trying to access an a potential alternate resource when grabbing your image for display, the wall feed box that comes up is a webview. Meaning web graphics. (It's FB's web page…meaning their rules, and i doubt the pages' source is available to dabble with within the SDK.. so!…
Look at the HTML of the feed itself with safari browser:
The inspection of the HTML within the final resulting image that is posted on my FB wall I can see this….
<img class="img" src="http://platform.ak.fbcdn.net/www/app_full_proxy.php?app=153675474666495&v=1&size=z&cksum=773bba91f6146b2463eed0a0bb77dc42&src=http%3A%2F%2Fwww.thumbwizards.com%2Fspeakinapps%2Fgraphics%2Fboxed%2Faussie.png" alt="">
I am wondering:
Within HTML5 isn't there a mechanism to provide a toolkit type of javascript to display retina graphics from a web page?
Would it be possible to have that code run when grabbing the url to the image (in meaning, the url of the image would be acting as a pointer to the code.? I haven't tried playing with this, since my logic tells me that per the url above that FB is essentially taking control over the image at this point. I have noticed (and not waited long enough to see) that the image is apparently cached and posting to the wall with a new image, sometimes results in the older image still being used. (and yes, i've cleared my browser cache)… perhaps simply cached in another location..
If there is another parameter for the image type, that is not published, I have not stumbled across any yet.
Can anyone figure out if through source of:
[http://platform.ak.fbcdn.net/www/app_full_proxy.php] if this php file is part of an available image processor out there we can access to view what could be done?
Can anyone mention an app that uses a retina graphic in their feed post?
Just thoughts really, I've decided to not really give a crop, and if
you've made it this far. Thanks for tuning in. ..So, Sulf, your 30x30 is being scaled to 90x90. making it UGLY!.
Good luck.. If you figure anything else out, let me know!
Mark
apple specify that if you want to add the retina effect for your ios app then the images you are using in this format -i.e
sampleImag.png- 57*57(size) , 163 (DPI)
sampleImag#2x.png - 114*114(size),326 (DPI) when you use these specific graphic images you will get your app is showing retina effect in iphone 4 and above generation.
Just point your code to a larger scaled image and Facebook will take care of the rest.