Image Processing · IT Consulting & Development | Custom Software, SAP, Microsoft

Image Processing

Home / CaseStudy / Image Processing

Border Detection

Processing of images digitally is of much importance since processes are digitalised and people take picture of different ID cards(driving license, passport etc) and upload for various purpose today(for instance filling online applications and forms for numerous reasons).First level of image processing algorithm is implemented on these images for seamless application processing before they are uploaded in the system due to the presence of various issues in the images like existence of white spaces, skewed image to name a few. In the case study we discuss:

  • Automatic ID card border detection and the image cropping
  • Removal of skewness(if present)
  • Correction of orientation

Solution

We used OpenCV library for image processing along with EmguCV wrapper, which is compatible with .NET languages (C#,VB,VC++ etc). We implemented the solution through the following steps:
  • Pre-processing to convert the image to greyscale and reduce the noise and improve image quality and size using PyrDown and PyrUp
Down sample -> Noise reduction -> Up-sample -> Image Enlargement
  • Edge detection using Canny algorithm(to convert image into collection of lines)
  • Detect outermost lines for Border detection through ‘Probabilistic Hough transform’ to filter out lines based on width & length
  • Using ‘FindContours’ to find objects at outer most location (to overcome the shortcomings of Hough transform)
  • Post processing which includes cropping the image along the border and getting a processed image containing ID card completely and removing any skewness present

Challenges

We encountered some issues as below: 

  • Establishing a pre-defined system criterion which needs to be met before uploading the picture. This includes deciding threshold value for the image processing algorithms to be implemented for removal of white spaces present on the side of ID card and skewness present in the image captured
  • The Canny algorithm used for border detection had some limitations and didn’t work in all the scenarios where ID card had more prominent rectangle drawn on it or an image with white background of a white ID card. These cases didn’t gave a correct collection of lines and may have resulted in incorrect border detection. To overcome this problem we implemented FindContours on binary image which gave us a more reliable result
  • We had to cater for devices of varying power and capability since this solution implementation had to run on various platforms. As we got into the testing phase we had to avoid large variation in responsiveness depending on the device used

 

Please fill in the details to download the case study.

Results

Accomplishments

  • EmguCV(the wrapper used with OpenCV library) is compatible with Xamarin(fosters app development). This implies that border detection can be used in creating Apps like CamScanner which detects the border and allows users to crop the unnecessary part of the image. This in turn enhances the usability of the our solution
  • The whole end-to-end process of image processing is streamlined. No interruption or time lag is caused due to uploading of improper scans, awkward or skewed photos of the ID card. Hence, robust image processing algorithms can be seamlessly applied to the ID card photos directly after they are uploaded
  • Mapping the border is important to get accurate results so we followed a set of steps to detect the outer border accurately. We used PyrDown method downsamples the image and reduces the noise then by using PyrUp method performs up-sampling, thus enlarging the image. This improves the overall image quality as well as the size of image and we got a 90% accuracy level.
  • We were able to add OCR capability to read the data and store in the database server and images in Azure blob storage.

Deliverables
An application to capture images using Browser camera based
Ability to detect images and crop and de-skew the imagesDoing OCR of the images Ability to store in Azure blob Storage and extract relevant information to the database

Other Case Studies

alt="IoT ecosystem"

AWS IoT application

Read more about how we created the IoT Application for Pharmaceutical refrigerator and helped them to automate and manage their business processes.

Mailchimp Email Automation

Read more about how Mailchimp can be used effectively and to manage your email channels and create automation using email to move your lead ahead in the buyer journey

Leave a Reply

Your email address will not be published. Required fields are marked *

× How can I help you?