Character Segmentation And Recognition

Approach Workflow:

  1. Image(Input)
  2. Text/Character Segmentation
  3. Denoising and Upscaling with Interpolation
  4. Character Recognition
  5. Saving to csv

Solution

  • The Dataset Contains 50 Mixed Images from Car,Two Wheelers and Posters.
  • On first look, most of the images don't need ROI filterings but after analysis, significant number of two wheeler images with a lot of background noise were found for which they need ROI filtering.

Applying ROI Filtering

  • Need ROI Filtering

  • For ROI Filtering, Warped Planar Object Detection Network was applied. WPOD-NET searches for License Plates and regresses one affine transformation for detection detection, allowing a rectification of the LP area to a rectangle resembling a frontal view

  • Here you can check the self-customized implementation of WPOD-NET extended on WPOD-NET Base and LPDR Pretrained-Weights

Results from ROI Filtering

  • Result

  • On results of ROI Filtering following techniques were applied:

    • OpenCV customised thresholding
    • Connected Components
    • Contour Detection and Selection.
    • Debluring
    • Constrast
    • Transformation etc.
  • Mentioned techniques can be observed in following images: Result

Since Dataset was mixed with around 50 samples in total it became harder for these naive methods to generalize. The extension to this is applying KNN models to characterise similar characters into a bucket and then assigning the value of the character based on the best image. Since the data provided was limited, moving into this way and verifying results became out of scope.

Some new adjustments were made in order for model to work on this diverse and small dataset.

Analysis and Findings On Dataset

  • While doing the explore study in terms of understanding the data distribution correctly including Contrast Adjustment Needs,occlusion,Spatial size for building the accurate approches for recognition.
  • Based on 50 images conclusion was drawn that ROI filtering and Text/Character Segmentation can be done by using Text Detection.

Final Approach

  • Finally, Applied KerasOCR for Character Detection and Wraped Perspective Transform for treating the tilt images were used.

  • Text Detection after KerasOCR,

    Result

    Result

    Result

    Result

  • After Analysis, KerasOCR's result were amplified by employing Tesseract for Final Recognition.

  • Final Steps For Solution

    • Image
    • kerasOCR
    • Denoising
    • Upscaling(Interpolation)
    • Debluring
    • Tesseract
    • Results
  • This whole apporach can be tested here : Colab Notebook or here

  • Result

  • Result

  • Result

  • Result

  • Result

  • Result

  • Result

Further Scope and Improvements

  • In some samples our approch is sometimes predicting Last 4 numbers in LP as characters because of distortion and low resolution and for the real world data which can be more noiser. So have found out SVHN housing number dataset which has more robust,occluded,low resolution and noisy data samples .Which will be perfect for recognising number

  • Samples:

  • Result

  • Result

Supporting Model and Weights