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

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,

Related

Shopify - Venture Theme - Product Background Image

I am using Venture Theme on Shopify. I am importing product images from another website with transparent background. And in my website, i am trying to show a background image which is in the Files directory in Shopify or a gradient color.
https://mottomfreedom.com/collections/less-is-more-skull-sweetshirt/products/skull-gr-sweatshirt-less-is-more-collection
I have been searching for a while but couldn't find a similar subject.
Please can any body help me with this?
#borasutcu
Solution 1: You are using PNG image, simply convert your image to JPG and it will have a background e.g https://i.stack.imgur.com/Sx82L.jpg
Solution 2: Set background to image div using CSS
Thanks for mentioning me #Deepak :) Actually i am a visual designer. My website is is receving the product image data from a different website. There will be a huge number of products and several images for each product. Converting an image from png to jpeg is an easy task but it will be a time consuming process in time. I was expecting a CSS solution. I am not experienced in coding but i think a few lines of code which is going to be added to product-card.liquid or theme.scss.liquid will solve my problem permanently. I searched for similar situations but couldn't find.
If you think that this is an inappropriate question for such a platform, i can delete my post.

How to add Cartoon Color and Cartoon B&W filter effect on Image in iPhone [duplicate]

Is there any filters available in ios to convert a image to cartoonistic image like exactly in the above picture?
For a much faster solution than ImageMagick, you could use the GPUImageToonFilter from my GPUImage framework:
It combines Sobel edge detection with posterization of the image to give a good cartoon-like feel. As implemented in this framework, it's fast enough to run on realtime video from the iPhone's camera, and is probably at least an order of magnitude faster than something similar in ImageMagick. My framework's also a little easier to integrate with an iOS project than ImageMagick.
If you want more of an abstract look to the image, the GPUImageKuwaharaFilter converts images into an oil painting style, as I show in this answer.
Try to use imagemagick for iOS http://www.imagemagick.org/download/iOS/
Of course you need some serval hours how to use imagemagick for iOS.
But then you should also look at: http://www.fmwconcepts.com/imagemagick/cartoon/index.php
and maybe also on:
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=11140&start=0&st=0&sk=t&sd=a
This Core Image filter section in the iOS dev library, possibly combined with the script referenced by Jonas and a little luck, might get you where you're going. Not sure, having never used either of these technologies.

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/.

How can you change a picture on the iPhone to make it look comicy or black and white?

I was wondering, are there any libraries on the iPhone that allow you to take an image and apply some sort of filter to it so the image turns out black and white, or to make it look comicy, or to skew it?
Start by taking a look at CoreImage. Its available in iOS5. You'll probably want to explore third party options too.
Check out OpenCV. It's an open source library that can be compiled for iOS (there's plenty of tutorials all around the net) and it's specifically made for things like image manipulation.
While it's harder to set up, it's a lot more powerful than CoreImage will be!
There's also plenty of sample code around the net that does things like turn images comicy/black and white/find image outlines/thresholds images etc. There's a small learning curve, but for what you want to do, it's more than worth it :)

How to do realtime face detection?

how can I realize realtime face detection, when I use iPhone camera to take picture?
just like the example: http://www.morethantechnical.com/2009/08/09/near-realtime-face-detection-on-the-iphone-w-opencv-port-wcodevideo/ (this example don't provide the .xcodeproj, so I can't compile .cpp file)
another example: http://blog.beetlebugsoftware.com/post/104154581/face-detection-iphone-source
(can't be compiled)
do you have any solution? please give a hand!
Wait for iOS 5:
Create amazing effects in your camera
and image editing apps with Core
Image. Core Image is a
hardware-accelerated framework that
provides an easy way to enhance photos
and videos. Core Image provides
several built-in filters, such as
color effects, distortions and
transitions. It also includes advanced
features such as auto enhance, red-eye
reduction and facial recognition.