- OS
import os
- OpenCV v3.4.3
import cv2
- Numpy v1.16
import numpy as np
- PIL
from PIL import Image
Following step has been used to extract the meter display:
- Read the image
- Convert the image from RGB to HSV colorspace
- Create a mask of the image where the color which falls in a particular range
- Find the largest contour in the mask image as the display will be the largest contour
- Create bounding box over the largest contour
- Extract the bounding box portion from the original image
- Use adaptive thresholding on the extracted meter display to get a binary image with less amount of noise
Further Processing required:
- Skew Correction of the extracted image
- Read the digits using OCR to get the meter reading