1. Field of the Invention
The present invention generally relates to a type of image processing, in particular, to a type of image processing that is suitable to serve as a preprocessing of a character recognition process.
2. Description of Related Art
Character recognition technologies that involve photographing an object including a character string and recognizing and obtaining the character string from the captured image become popular. Generally, an object has a three-dimensional shape and includes various materials, so that according to a camera disposition position or an illumination condition when an image is captured, sometimes not only diffusely reflected light is photographed, but also specularly reflected light is photographed. A luminance value of the specularly reflected light, as compared with that of the diffusely reflected light, is extremely high, and with the saturation of the luminance value, the specularly reflected light becomes a reason why accuracy of a character cutout process or character recognition process decreases.
For example, binarization of an image is performed as preprocessing prior to a character recognition process. A method, referred to as dynamic binarization, is proposed as a binarization method, that is, in order to eliminate influence of a partial shadow, a threshold is dynamically determined on the basis of a luminance value in a partial region (patent document 1). In this case, if a high luminance region caused by specularly reflected light exists in a captured image, sometimes it is impossible to perform proper binarization, which exerts unfavorable influence on a subsequent character recognition process.
A situation, in which a number plate of a vehicle is used as an object to perform character recognition, is used as an example for further specific description.
The description is merely an example of unfavorable influence exerted by a high luminance region (a saturated region) caused by specularly reflected light. Even in a situation in which a dynamic binarization process is not performed as preprocessing, a situation in which an object is other than a number plate, or the like, accuracy of a character recognition process decreases due to existence of a high luminance region.
Patent document 1: JP2003-123023
In view of the facts, the present invention is completed and is directed to providing a technology, which enables high-accuracy character recognition to be implemented even in a situation in which a high luminance region caused by specularly reflected light or the like exists in an input image.
In order to achieve the objective, in the present invention, as a preprocessing of a character recognition process, a high luminance region of an image is determined, and a pixel value of the high luminance region is converted, so as to suppress unfavorable influence caused by the high luminance region generated because of specularly reflected light or the like.
Specifically, a form of the present invention is an image processing device for performing a preprocessing of an image recognition process to an input image, including: a generation element for generating a histogram of luminance values of the input image; a determination element for determining a reference value for the luminance values on the basis of the histogram and determining a high luminance pixel, that is, a pixel having a luminance value greater than the reference value; and a conversion element for converting the luminance value of the high luminance pixel into a luminance value lower than or equal to the reference value.
In addition, also preferably, in the present invention, the determination element determines one or more peak ranges of luminance values on the basis of the histogram and determines the reference value on the basis of an upper limit value of the peak range having a greatest luminance value.
In addition, also preferably, in the present invention, the determination element determines one or more peak ranges of luminance values on the basis of the histogram and determines the reference value on the basis of an upper limit value of the peak range having a second greatest luminance value.
Moreover, also preferably, in the present invention, the determination element clusters luminance values into multiple ranges on the basis of a difference of a gravity center between a degree corresponding to a luminance value and a degree near the luminance value, and determines a range among the multiple ranges to be the peak range, in which a range width or a sum of degrees in the range is greater than a threshold.
In addition, also preferably, in the present invention, the conversion element converts the luminance value of the high luminance pixel into the reference value.
Moreover, also preferably, in the present invention, the conversion element converts the luminance value of the high luminance pixel into a luminance value calculated on the basis of luminance values of pixels surrounding the pixel.
In addition, another form of the present invention is a character recognition device, including: the foregoing image processing device; and a recognition element for performing a character recognition process on an image processed by the image processing device.
Moreover, also preferably, the input image includes at least one part of a number plate, and the recognition element performs the character recognition process on a character drawn on the number plate.
Furthermore, the present invention can be mastered as an image processing device or a character recognition device including at least one part of the element. In addition, the present invention may also be mastered as an image processing method or a character recognition method. Moreover, the present invention may also be mastered as a computer program used to enable a computer to execute each step of the methods or a computer-readable storage medium that non-temporarily stores the program. The structures and processes can be respectively combined in a scope in which no technical contradiction is generated, so as to constitute the present invention.
According to the present invention, a high luminance region, caused by specularly reflected light or the like, of an input image can be corrected, so as to suppress unfavorable influence caused by the high luminance region and implement high-accuracy character recognition.
Preferable forms for implementing the present invention are illustrated in detail below by referring to the accompanying drawings. However, as long as the size, material, shape, corresponding configuration, or the like of a constituent piece disclosed in the following implementation manners is not specially disclosed, the scope of the present invention is not merely limited to the main idea of the contents.
<First Implementation Manner>
The calculation device 12 executes a program, so as to implement functions shown in
Step S11 is preprocessing performed to adapt the image data to character recognition and is performed by the preprocessing element 100. The preprocessing includes a luminance value correction process on a high luminance pixel of the image, a binarization process, a noise removal process, and the like.
In step S12, the character extraction element 110 extracts a character region from the preprocessed image and further extracts a character region of each character from the character region. In step S13, the character recognition element 120 extracts a feature of a character from each character region and matches the extracted character with each character in dictionary data to perform recognition on the extracted character. Any existing technology is applicable to cutout of a character region and an obtaining or matching process on a character feature amount. For example, a pixel feature extraction method, a contour feature extraction method, a gradient feature extraction method, or the like may be used as a method for obtaining a character feature. In addition, a method, such as a partial space method, a neural network, a Support Vector Machine (SVM), or discriminant analysis, may be used as a character recognition method.
A correction process on a luminance value (a pixel value) of a high luminance pixel in feature processing, that is, preprocessing, in the present invention is described in the following.
First, in step S20, grayscale conversion is performed on an input image. The number of scales of a grayscale image is not specially defined, and for example, may be set to 256 scales. In step S21, the histogram generation element 101 generates a histogram of luminance values from an image that has been converted into grayscales. In this implementation manner, a bin width of the histogram is set to 1, but the bin with can also be greater than 1.
In step S22, the high luminance pixel determination element 102 uses the histogram as an object to perform clustering. The clustering is directed to determining a range for obtaining a peak of luminance values and involves determining a peak range to be a cluster. A luminance value outside the peak range is determined to not belong to any cluster. The clustering in step S22 is described in more detail in the following.
GLi=Σ
j(Lj×mj)/Σj(mj)
Herein, Σ (sigma) (a sum) is a sum involving j and indicating a range of i−N/2to i+N/2, and mj indicates a degree of a luminance value Lj in the histogram.
In step S31, a difference between the gravity center luminance value GLi and the luminance value Li in each bin (each luminance value) is calculated as a shift Si. That is, an equation is set as:
Si=GLi−Li,
to determine the shift Si.
In step S32, a shift in each bin (each luminance value) is quantified into three values, that is, plus (+), minus (−), and zero (0). In this implementation manner, if the shift Si is 0.5 or above, the shift Si is considered to be plus, if the shift Si is −0.5 or below, the shift Si is considered to be minus, and otherwise, the shift Si is considered to be zero. A value other than 0.5 may be also used as a threshold in the quantification. In addition, the threshold of the quantification may also be changed by using the bin width of the histogram, and for example, may also be a half of the bin width.
Return to the descriptions of the flowchart of
In step S34, a cluster that does not satisfy a specified reference is excluded from the clusters obtained in step S33. An example of a reference may be that: a width of a cluster is greater than or equal to a specified threshold; or a sum of degrees (the number of pixels belonging to the cluster) in the cluster is greater than or equal to a specified threshold. A cluster not having a width is removed, and for example, a cluster is effective because it can distinguish a saturated pixel from other peaks. In a case in which an overall image is bright, a peak with a width under a greatest luminance value (which is a luminance value 255 in this implementation manner) is detected, and in a case in which over-exposure is generated because of influence of specularly reflected light and the like, a peak without a width under the greatest luminance value is detected. By regulating conditions concerning the cluster width, a pixel of a correction object can be properly determined in a case in which influence of specularly reflected light exists.
By element of the above, the clustering of step S22 illustrated in the flowchart of
In step S23, the high luminance pixel determination element 102 determines an upper limit value (a greatest value) of luminance values of a cluster having a greatest luminance value in the clusters obtained in step S22 to be a threshold (a reference value) T. The threshold T is used to determine whether a pixel is a high luminance pixel, and more specifically, a pixel having a luminance value greater than the threshold T is determined to be a high luminance pixel. In the example of
In step S24, the conversion element 103 sets a luminance value of a pixel (a high luminance pixel) having a luminance value greater than the threshold T to T. Hence, all the luminance values of the high luminance pixels in the image are replaced with a value of an upper limit value (T) of the greatest cluster.
In addition, the flowchart of
According to this implementation manner, a high luminance pixel of a correction object is determined on the basis of a histogram of luminance values, so that as compared with an approach of performing correction by fixedly determining a luminance value range of a correction object, this implementation manner can suppress influence of specularly reflected light and the like more properly. In addition, influence caused by specularly reflected light can be suppressed, so that accuracy of a character recognition process can be improved.
<Second Implementation Manner>
The second implementation manner differs from the first implementation manner in a determination method of substituting, by the conversion element 103, a luminance value of a high luminance pixel (a correction object pixel) in a correction process. In the first implementation manner, all high luminance pixels are substituted with the threshold T, but in this implementation manner, a luminance value after correction is determined on the basis of luminance values of surrounding pixels of the correction object pixel.
In step S41, a flag is granted for a pixel (a high luminance pixel) having a luminance value greater than a threshold T. In step S42, labeling is performed on the pixel with the flag. In step S43, a contour of a label is extracted.
Processes of step S44 to step S47 are performed on respective pixels on the contour in sequence. In step S44, a pixel on the contour is selected. The selected pixel herein is referred to as a pixel P. In addition, the pixels on the contour extracted in step S43 all have the same priority, and which pixel is first processed does not matter. In step S45, a pixel without a flag is extracted from surrounding pixels of the pixel P. The so-called surrounding pixels, for example, may be pixels (other than the pixel P) in a range of 3×3 to 7×7 with the pixel P as a center or may be four adjacent pixels of the pixel P and the like. In step S46, an average value of luminance values of the pixels extracted in step S47 is calculated, and the average value is substituted as the luminance value of the pixel P. In step S48, the flag is removed from the pixel P, so as to update the contour. In step S48, it is determined whether a pixel with a flag remains, and if so, step S44 is performed again to repeat the process. In addition, in pixel selection in step S44, a pixel whose timing of being extracted as a contour is earlier is more preferentially selected.
According to this implementation manner, interpolation can be smoothly performed on a high luminance pixel region by using luminance values of surrounding pixels. Therefore, it would be difficult for a corrected image to generate a false contour, so that accuracy of a character recognition process can be improved.
<Other Implementation Manners>
Descriptions of the implementation manners are merely used to illustratively explain the present invention, and the present invention is not limited to the specific forms. Various deformations may be performed on the present invention within the scope of the technical idea.
In the descriptions, a system for recognizing a number plate of a vehicle is described, but this system is applicable to any character recognition system. The present invention can be preferably applied to a case in which not only diffusely reflected light but also specularly reflected light of illumination and the like is projected into an image. For example, the present invention can be applied to a character recognition system used in Factory Automation (FA) for recognizing characters recorded on surfaces of aluminum cans or plastics. In addition, the preprocessing in the descriptions is applicable not only as a preprocessing of a character recognition process, but also, preferably, as preprocessing of other image recognition processes.
In addition, in the descriptions, a system that performs image capturing of a camera, a correction process on a high luminance pixel, and a character recognition process is described, but the image may also be obtained by element of a method other than photographing of a camera. For example, the present invention can be constituted as a character recognition device described below, where the character recognition device obtains an image by element of data communication or a recording medium and performs a correction process and a character recognition process on the obtained image. Moreover, the present invention can also be constituted as an image processing device that merely performs a correction process on an image.
In the descriptions, in order to determine a peak range from a histogram, clustering is used, but a peak range can also be determined by using a method other than clustering. For example, determining a degree threshold according to an overall luminance value of an image and determining a range having a degree greater than the threshold to be a peak range may be taken into consideration. At this time, also preferably, when a width of the peak range determined in this way is less than a specified value or the number of pixels in the peak range is less than a specified value, the peak range is not processed as a peak range. In addition, in this method, a saturated region may become a peak range, and in this case, a reference value may also be determined on the basis of a peak range having a second greatest luminance value rather than a peak range having a greatest luminance value.
In the descriptions, an example of providing a function by executing, by a general processor, a software program is described, but a dedicated hardware circuit may also be used to provide the function.
The character recognition device of this implementation manner may be mounted in any device such as a desktop computer, a notebook computer, a slate computer, or a smart phone. In addition, respective functions of the character recognition device in the descriptions do not need to be implemented by one device and may also be implemented by multiple devices by sharing their respective functions.
10: Character recognition device (Image processing device)
100: Preprocessing element
101: Histogram generation element
102: High luminance determination element
103: Conversion element
104: Binarization element
110: Character extraction element
120: Character recognition element
20: Camera
Number | Date | Country | Kind |
---|---|---|---|
2014-223028 | Oct 2014 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2015/080822 | 10/30/2015 | WO | 00 |