Remove background color in image processing for OCR

前端 未结 6 2104
借酒劲吻你
借酒劲吻你 2021-02-01 10:50

I am trying to remove background color so as to improve the accuracy of OCR against images. A sample would look like below:

6条回答
  •  孤独总比滥情好
    2021-02-01 11:52

    You can apply blur to the image, so you get almost clear background. Then divide each color component of each pixel of original image by the corresponding component of pixel on the background. And you will get text on white background. Additional postprocessing can help further.

    This method works in the case if text is darker then the background (in each color component). Otherwise you can invert colors and apply this method.

提交回复
热议问题