CN107845080B - Card image enhancement method - Google Patents

Card image enhancement method Download PDF

Info

Publication number
CN107845080B
CN107845080B CN201711191889.6A CN201711191889A CN107845080B CN 107845080 B CN107845080 B CN 107845080B CN 201711191889 A CN201711191889 A CN 201711191889A CN 107845080 B CN107845080 B CN 107845080B
Authority
CN
China
Prior art keywords
image
card image
card
highlight
space
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711191889.6A
Other languages
Chinese (zh)
Other versions
CN107845080A (en
Inventor
杨晓城
王勇
施宇伦
卜佳俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sinyada Technology Co.,Ltd.
Original Assignee
SUNYARD SYSTEM ENGINEERING Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SUNYARD SYSTEM ENGINEERING Co Ltd filed Critical SUNYARD SYSTEM ENGINEERING Co Ltd
Priority to CN201711191889.6A priority Critical patent/CN107845080B/en
Publication of CN107845080A publication Critical patent/CN107845080A/en
Application granted granted Critical
Publication of CN107845080B publication Critical patent/CN107845080B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Character Input (AREA)

Abstract

The invention provides a card image enhancement method, which comprises the following steps: obtaining a card image acquired by a mobile terminal; denoising the acquired card image to obtain a first card image; converting the first card image from an RGB space to a YCrCb space, extracting a Y space image in the first card image to judge whether the first card image has highlight or not; if the first card image has a highlight area, removing the highlight area by converting the brightness characteristic of the highlight area to obtain a second card image; performing inclination correction on the second card image to obtain a third card image; and carrying out optical character recognition on the third card image, and outputting a recognition result. Determining highlight of the card image from the extracted Y-space image by converting the card image from an RGB space to a YCrCb space, and removing the highlight by converting a luminance characteristic of a highlight region; therefore, highlight and inclination problems of the card image are quickly removed and corrected, so that the recognition rate of subsequent optical character recognition is improved.

Description

Card image enhancement method
Technical Field
The invention relates to the technical field of image processing, in particular to a card image enhancement method for mobile terminal acquisition.
Background
In people's daily life, it is often necessary to obtain relevant information from certificates. Generally, an image of a card such as a certificate is captured by an imaging device such as a scanner, then the image is subjected to some necessary processing by using an image processing technology, and finally, related information in the card image is identified and extracted by using an Optical Character Recognition (OCR) technology. In recent years, with the development of mobile communication and internet technologies, a large number of mobile terminal devices such as smart phones and tablet computers are gradually becoming an indispensable part of people's lives. These mobile devices all have a camera function, and are widely used in related industries such as finance and internet, and meanwhile, new changes and challenges are brought to traditional card image processing and recognition. For the card image collected by the mobile terminal, two common problems are that the image has high light and inclination, which makes the relevant information in the card image possibly unable to be identified or the identification result is wrong, and finally the relevant information input may fail. Therefore, there is a need for fast removal and correction of high light and tilt of card images captured by a moving end.
Highlight detection and removal of a single image has been a difficult point. The main methods at present are as follows: the first method is complementary color, and fills the image area by extracting the surrounding image features to remove highlights, which has the disadvantages of large amount of information to be processed, slow processing speed, and loss of the original image features in the highlights area. The second method is to remove the high light according to the reflection model, which has the disadvantage that the repair results are poor if the emission model is too simple; if the reflection model is too complex, the processing speed is slow and the algorithm is less applicable. The third method is illumination constraint color compensation, which combines the common color compensation method with the illumination constraint condition to remove the highlight, and has the disadvantages of complex algorithm, large information amount of processing and slow processing speed. In summary, the conventional method solves the problems of excessive calculation amount and slow processing speed of highlight.
Disclosure of Invention
The invention provides a card image enhancement method, which solves the problems in the prior art.
In order to solve the above problem, an embodiment of the present invention provides a card image enhancement method, including the following steps:
obtaining a card image acquired by a mobile terminal;
denoising the acquired card image to obtain a first card image;
converting the first card image from an RGB space to a YCrCb space, extracting a Y space image in the first card image to judge whether the first card image has highlight or not;
if the first card image has a highlight area, removing the highlight area by converting the brightness characteristic of the highlight area to obtain a second card image;
performing inclination correction on the second card image to obtain a third card image;
and carrying out optical character recognition on the third card image, and outputting a recognition result.
As an embodiment, the transforming the first card image from RGB space to YCrCb space, extracting Y space image therein to determine whether the first card image has highlights includes the following steps:
converting the first card image from an RGB space to a YCrCb space, and extracting a Y space image in the first card image as an image to be detected;
setting a highlight detection threshold value, and setting a pixel value lower than the highlight detection threshold value in an image to be detected as 0;
carrying out binarization processing on an image to be detected, and then carrying out morphological operation to obtain a highlight area of a first card image, wherein the morphological operation comprises opening operation and corrosion;
and confirming whether the first card image is highlight or not according to the corroded image.
As an embodiment, if the first card image has a highlight area, the highlight area is removed by converting the brightness characteristic of the highlight area to obtain the second card image, specifically including the following steps:
normalizing the brightness Y value in the Y space image to obtain a normalized Y image;
performing histogram equalization operation on the normalized Y image to obtain an equalized Y image;
and replacing the original brightness Y value with the new brightness Y value through a conversion polynomial according to the image brightness conversion criterion on the equalized Y image to obtain a second card image.
In one embodiment, the normalization process of the luminance Y value in the Y space image is performed such that the maximum value of the luminance Y value is mapped to 1 and the minimum value of the luminance Y value is mapped to 0.
As an embodiment, the conversion polynomial is:
y=2.5208Y5-4.8316Y4+2.3675Y3-0.4013Y2+0.9998Y。
as an embodiment, the tilt correcting the second card image to obtain the third card image specifically includes the following steps:
graying the second card image;
then, edge detection is carried out by using a Canny operator to obtain a second card binary image;
calculating the slope of the edge straight line of the second card binary image by using a least square method;
and calculating according to the slope to obtain an angle, and then rotating the image to obtain a third card image.
As an implementation mode, a median filtering method is adopted to carry out denoising processing on the acquired card image.
Compared with the prior art, the invention has the beneficial effects that: determining whether the card image has highlight according to the extracted Y space image by converting the card image collected by the mobile terminal from an RGB space to a YCrCb space; if the highlight exists, removing the highlight by converting the brightness characteristic of the highlight area, and then performing inclination correction; therefore, highlight and inclination problems of the card image are quickly removed and corrected, so that the recognition rate of subsequent optical character recognition is improved.
Drawings
FIG. 1 is a flow chart of a card image enhancement method of the present invention;
FIG. 2 is a flowchart illustrating steps 300 of a card image enhancement method according to the present invention;
FIG. 3 is a flowchart illustrating the steps 400 of the card image enhancement method according to the present invention;
FIG. 4 is a flowchart illustrating steps 500 of a card image enhancement method according to the present invention;
FIG. 5 is an original card image captured by the mobile terminal;
FIG. 6 is a highlight region of a first card image processed by the card image enhancement method of the present invention;
FIG. 7 is a second card image obtained after highlight removal by the card image enhancement method of the present invention;
FIG. 8 is a third card image obtained after the card image enhancement method of the present invention is tilt-corrected.
Detailed Description
The above and further features and advantages of the present invention will be apparent from the following, complete description of the invention, taken in conjunction with the accompanying drawings, wherein the described embodiments are merely some, but not all embodiments of the invention.
As shown in fig. 1, a card image enhancement method includes the following steps:
s100: obtaining a card image collected by the mobile terminal, as shown in fig. 5;
s200: denoising the acquired card image to obtain a first card image, and in the embodiment, denoising the acquired card image by using a median filtering method;
s300: converting the first card image from an RGB space to a YCrCb space, extracting a Y space image in the first card image to judge whether the first card image has highlight or not;
s400: if the first card image has a highlight area, removing the highlight area by converting the brightness characteristic of the highlight area to obtain a second card image;
s500: performing inclination correction on the second card image to obtain a third card image;
s600: and performing Optical Character Recognition (OCR) on the third card image, and outputting a recognition result.
As shown in fig. 2, step S300 specifically includes the following steps:
s301: converting the first card image from an RGB space to a YCrCb space, and extracting a Y space image in the first card image as an image to be detected;
s302: setting a highlight detection threshold value, and setting a pixel value lower than the highlight detection threshold value in an image to be detected as 0;
s303: performing binarization processing on an image to be detected, and then performing morphological operations to obtain a highlight area of the first card image, as shown in fig. 6, in the present embodiment, the morphological operations include opening operation and corrosion;
s304: and confirming whether the first card image is highlight or not according to the corroded image.
As shown in fig. 3, step S400 specifically includes the following contents:
s401: normalizing the brightness Y value in the Y space image to obtain a normalized Y image, wherein in the embodiment, the normalization is to map the maximum value of the brightness Y value to 1 and map the minimum value of the brightness Y value to 0;
s402: performing histogram equalization operation on the normalized Y image to obtain an equalized Y image;
s403: for the equalized Y image, replacing the original luminance Y value with the new luminance Y value by a conversion polynomial according to the image luminance transformation criterion to obtain a second card image, as shown in fig. 7, in this embodiment, the conversion polynomial is: Y2.5208Y5-4.8316Y4+2.3675Y3-0.4013Y2+0.9998Y, the image brightness conversion criterion is to reduce the brightness of the high light area in the image and ensure the brightness of the area with lower image brightness to be basically unchanged, therefore, the invention comprehensively considers the image brightness conversion criterion and the calculation amount and adopts the fifth-order polynomial to carry out conversion.
The traditional image tilt correction method mainly comprises a Fourier transform-based method, a Hough transform-based method, a projection-based method, a cross correlation-based method, a K-nearest neighbor cluster method and the like. The main disadvantages of these methods are the excessive amount of computation and the poor adaptability of some algorithms.
In this embodiment, as shown in fig. 4, the tilt correction step S500 specifically includes the following steps:
s501: graying the second card image;
s502: then, edge detection is carried out by using a Canny operator to obtain a second card binary image;
s503: calculating the slope of the edge straight line of the second card binary image by using a least square method;
s504: the angle is calculated from the slope and the image is then rotated to obtain a third card image, as shown in fig. 8.
Compared with the traditional image inclination correction method, the inclination correction method adopted by the invention can quickly correct the inclined card image, and has the advantages of simple method, small calculated amount and easy realization.
The card image collected by the mobile terminal is converted into a YCrCb space from an RGB space, and whether the card image has high light or not is determined according to the extracted Y space image; if the highlight exists, removing the highlight by converting the brightness characteristic of the highlight area; therefore, highlight and inclination problems of the card image are quickly removed and corrected, so that the recognition rate of subsequent optical character recognition is improved.
The above-mentioned embodiments are provided to further explain the objects, technical solutions and advantages of the present invention in detail, and it should be understood that the above-mentioned embodiments are only examples of the present invention and are not intended to limit the scope of the present invention. It should be understood that any modifications, equivalents, improvements and the like, which come within the spirit and principle of the invention, may occur to those skilled in the art and are intended to be included within the scope of the invention.

Claims (5)

1. A card image enhancement method is characterized by comprising the following steps:
obtaining a card image acquired by a mobile terminal;
denoising the acquired card image to obtain a first card image;
converting the first card image from an RGB space to a YCrCb space, extracting a Y space image in the first card image to judge whether the first card image has highlight or not;
if the first card image has a highlight area, removing the highlight area by converting the brightness characteristic of the highlight area to obtain a second card image;
performing inclination correction on the second card image to obtain a third card image;
carrying out optical character recognition on the third card image, and outputting a recognition result;
the method for judging whether the first card image has highlight or not by converting the first card image from an RGB space to a YCrCb space and extracting a Y space image in the first card image specifically comprises the following steps:
converting the first card image from an RGB space to a YCrCb space, and extracting a Y space image in the first card image as an image to be detected;
setting a highlight detection threshold value, and setting a pixel value lower than the highlight detection threshold value in an image to be detected as 0;
carrying out binarization processing on an image to be detected, and then carrying out morphological operation to obtain a highlight area of a first card image, wherein the morphological operation comprises opening operation and corrosion;
confirming whether the first card image is highlight or not according to the corroded image;
if the first card image has a highlight area, removing the highlight area by converting the brightness characteristic of the highlight area to obtain a second card image, specifically comprising the following steps of:
normalizing the brightness Y value in the Y space image to obtain a normalized Y image;
performing histogram equalization operation on the normalized Y image to obtain an equalized Y image;
and replacing the original brightness Y value with the new brightness Y value through a conversion polynomial according to the image brightness conversion criterion on the equalized Y image to obtain a second card image.
2. The card image enhancement method according to claim 1, wherein the normalization processing of the luminance Y value in the Y space image is performed such that the maximum value of the luminance Y value is mapped to 1 and the minimum value of the luminance Y value is mapped to 0.
3. The card image enhancement method of claim 1, wherein the conversion polynomial is:
y=2.5208Y5-4.8316Y4+2.3675Y3-0.4013Y2+0.9998Y。
4. the card image enhancement method according to any one of claims 1 to 3, wherein the tilt correction is performed on the second card image to obtain a third card image, and the method specifically comprises the following steps:
graying the second card image;
then, edge detection is carried out by using a Canny operator to obtain a second card binary image;
calculating the slope of the edge straight line of the second card binary image by using a least square method;
and calculating according to the slope to obtain an angle, and then rotating the image to obtain a third card image.
5. The card image enhancement method of claim 1, wherein the acquired card image is denoised by a median filtering method.
CN201711191889.6A 2017-11-24 2017-11-24 Card image enhancement method Active CN107845080B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711191889.6A CN107845080B (en) 2017-11-24 2017-11-24 Card image enhancement method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711191889.6A CN107845080B (en) 2017-11-24 2017-11-24 Card image enhancement method

Publications (2)

Publication Number Publication Date
CN107845080A CN107845080A (en) 2018-03-27
CN107845080B true CN107845080B (en) 2020-03-20

Family

ID=61679350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711191889.6A Active CN107845080B (en) 2017-11-24 2017-11-24 Card image enhancement method

Country Status (1)

Country Link
CN (1) CN107845080B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111275648B (en) * 2020-01-21 2024-02-09 腾讯科技(深圳)有限公司 Face image processing method, device, equipment and computer readable storage medium
CN115578695B (en) * 2022-11-21 2023-03-28 昆明理工大学 Water gauge water level machine vision detection method and device with free shooting visual angle

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140054690A (en) * 2012-10-29 2014-05-09 서울여자대학교 산학협력단 Automatic fusion system and the method of t2-weighted mr image and diffusion weighted mr image
CN104616268A (en) * 2015-02-17 2015-05-13 天津大学 Underwater image restoration method based on turbulence model
KR20150144727A (en) * 2014-06-17 2015-12-28 주식회사 유진로봇 Apparatus for recognizing location mobile robot using edge based refinement and method thereof
CN105205792A (en) * 2015-09-18 2015-12-30 天津大学 Underwater image enhancement method based on brightness and chrominance separation
US9330340B1 (en) * 2014-05-06 2016-05-03 Google Inc. Noise estimation for images using polynomial relationship for pixel values of image features
CN105957042A (en) * 2016-06-07 2016-09-21 北京理工大学 Highlight region eliminating method of endoscopic image
CN107274385A (en) * 2017-05-18 2017-10-20 常州大学 Textile flaw detection method based on class grid pattern and its Gabor characteristic

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140054690A (en) * 2012-10-29 2014-05-09 서울여자대학교 산학협력단 Automatic fusion system and the method of t2-weighted mr image and diffusion weighted mr image
US9330340B1 (en) * 2014-05-06 2016-05-03 Google Inc. Noise estimation for images using polynomial relationship for pixel values of image features
KR20150144727A (en) * 2014-06-17 2015-12-28 주식회사 유진로봇 Apparatus for recognizing location mobile robot using edge based refinement and method thereof
CN104616268A (en) * 2015-02-17 2015-05-13 天津大学 Underwater image restoration method based on turbulence model
CN105205792A (en) * 2015-09-18 2015-12-30 天津大学 Underwater image enhancement method based on brightness and chrominance separation
CN105957042A (en) * 2016-06-07 2016-09-21 北京理工大学 Highlight region eliminating method of endoscopic image
CN107274385A (en) * 2017-05-18 2017-10-20 常州大学 Textile flaw detection method based on class grid pattern and its Gabor characteristic

Also Published As

Publication number Publication date
CN107845080A (en) 2018-03-27

Similar Documents

Publication Publication Date Title
US9898808B1 (en) Systems and methods for removing defects from images
EP1910994B1 (en) Binarization of an image
US8611662B2 (en) Text detection using multi-layer connected components with histograms
US9679354B2 (en) Duplicate check image resolution
CN109993161B (en) Text image rotation correction method and system
US9245194B2 (en) Efficient line detection method
CN108965646B (en) Image processing apparatus, image processing method, and program
CN108146093A (en) A kind of method for removing bill seal
CN107845080B (en) Card image enhancement method
CN114820594A (en) Method for detecting edge sealing defects of plate based on image, related equipment and storage medium
WO2024016632A1 (en) Bright spot location method, bright spot location apparatus, electronic device and storage medium
CN110738604A (en) Canny operator and Hough transformation-based large-dip angle certificate image correction method and system
JP2014174803A (en) Moire removal method for pattern recognition, moire removal device using the same, and program
Lin et al. License plate recognition based on mathematical morphology and template matching
CN112419207A (en) Image correction method, device and system
JP2015115067A (en) Method and device for extracting distorted straight line from image
JP5870745B2 (en) Image processing apparatus, binarization threshold value calculation method, and computer program
CN105809677B (en) Image edge detection method and system based on bilateral filter
CN111445402A (en) Image denoising method and device
CN115862044A (en) Method, apparatus, and medium for extracting target document part from image
JP6661268B2 (en) Image processing apparatus, image processing method, and program
WO2022056875A1 (en) Method and apparatus for segmenting nameplate image, and computer-readable storage medium
CN114219760A (en) Reading identification method and device of instrument and electronic equipment
JP2020149184A (en) Information processor and control method thereof and program
JP2019021085A (en) Image processing program, image processing method, and image processing device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: Xinyada technology building, 3888 Jiangnan Avenue, Binjiang District, Hangzhou City, Zhejiang Province 310000

Patentee after: Sinyada Technology Co.,Ltd.

Address before: Xinyada technology building, 3888 Jiangnan Avenue, Binjiang District, Hangzhou City, Zhejiang Province 310000

Patentee before: SUNYARD SYSTEM ENGINEERING Co.,Ltd.

CP01 Change in the name or title of a patent holder