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


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


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.



    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

    • All
    • Case Study
    Case Study Machineroad

    Read more about how we integrated SAP with HubSpot APIS for one of our clients.

    We integrated the solution design to match the requirement and made it configurable to run for multiple clients on Hubspot.

    Read More →
    SAP Integration with 3rd Party – REST, WSDL based

    Read more to understand how we help clients to move to cloud from their existing system landscape. For instance, how we helped one of our clients to move their website hosted in WordPress to Azure. 

    Read More →
    Mailchimp 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.

    Download the checklist to know more.

    Read More →
    Image Processing

    Read more about how we implemented an image processing application and did OCR and added algorithms to improve accuracy.

    Read More →
    Zoho Integration Case Study

    This case study Talks about how we integrated SQL server data to migrate to a New Zoho instance. It helps to save a lot of data migration and manual effort as we created the integration to use the existing APIs
    Read more to find out

    Read More →
    Power BI integration with Quickbooks

    Read about how we successfully integrated QuickBooks(an accounting software) with Power BI to generate custom reports and visualize updated data real time.

    Read More →