How to classify blurry numbers with openCV

后端 未结 2 759
无人及你
无人及你 2021-01-31 04:43

I would like to capture the number from this kind of picture.

I tried multi-scale matching from the following link.

http://www.pyimagesearch.com/2015/

2条回答
  •  悲&欢浪女
    2021-01-31 05:36

    You have a couple of things you can use to your advantage:

    • The number is within the black rectangular bezel and one colour
    • The number appears to be a segmented LCD type display, if so there are only a finite number of segments which are off or on.

    So I suggest you:

    • Calibrate your camera and preprocess the image to remove lens distortion
    • Rectify the display rectangle:
      • Detect the display rectangle using either the intersection of hough lines, or edge detection followed by contour detection and then pick the biggest, squarest contours
      • use GetPerspectiveTransform to get the transform between image coordinates and an ideal rectangle, then transform the input image using WarpPerspective
    • Split image into R, G and B channels and work out r - avg(g, b), this is a bit lighting dependent but should give something like this:

    • Then either try pattern matching on this, or perhaps re-segment the image and attempt to find which display segments are lit, or run through an OCR package.

提交回复
热议问题