CN103955684B - character extracting method, device and terminal - Google Patents
character extracting method, device and terminal Download PDFInfo
- Publication number
- CN103955684B CN103955684B CN201410127565.6A CN201410127565A CN103955684B CN 103955684 B CN103955684 B CN 103955684B CN 201410127565 A CN201410127565 A CN 201410127565A CN 103955684 B CN103955684 B CN 103955684B
- Authority
- CN
- China
- Prior art keywords
- pixel point
- pixel
- directions
- gradient
- character
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 238000000605 extraction Methods 0.000 claims abstract description 53
- 238000012545 processing Methods 0.000 claims abstract description 26
- 238000010606 normalization Methods 0.000 claims description 12
- 238000004364 calculation method Methods 0.000 claims description 11
- 230000008859 change Effects 0.000 abstract description 7
- 238000005286 illumination Methods 0.000 abstract description 6
- 238000004891 communication Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 7
- 239000000284 extract Substances 0.000 description 7
- 238000012015 optical character recognition Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 230000001133 acceleration Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Landscapes
- Character Input (AREA)
- Image Analysis (AREA)
Abstract
The disclosure is directed to a kind of character extracting method, device and terminal, belong to technical field of image processing.Method includes:For each pixel in target image, on a direction in preset number direction, centered on pixel, according to the fineness of character lines in target image, a block is selected in the target image;According to the pixel value of each pixel in block, the gradient symmetrical degree of correlation of the pixel on direction is calculated;According to the symmetrical degree of correlation of gradient of each pixel on preset number direction, line character extraction is entered in the target image.The disclosure is entered line character based on the symmetrical degree of correlation of gradient of each pixel on preset number direction in target image and extracted, due to illumination light and shade situation of change robust of this kind of character extracting mode to large scale, so being not only applicable to block letter image, the non-printing body images such as bank card or car plate comprising elevated regions are could be applicable to, this kind of character extracting mode has stronger universality.
Description
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a character extraction method, an apparatus, and a terminal.
Background
With the continuous progress of society, Character Recognition using an OCR (Optical Character Recognition) system has been widely used in various industries, such as pass processing, security document processing (checks, financial documents, bills), mail tracking processing, and the like. Since the OCR system requires a clear character, a single background, and a high resolution in the character area when performing character recognition, how to extract the character becomes a key problem in order to enable the OCR system to effectively recognize the character.
In the related art, character extraction is performed based on character segmentation and color clustering. Firstly, cutting each line of regional images containing a plurality of characters into a plurality of sub-regional images only containing single characters; then, for any subregion image, performing color clustering on the subregion image according to the character color characteristics, and separating different color layers; then, finding a color layer containing the most character information from a plurality of color layers, and taking the color layer as a single character extraction image; repeatedly executing the two steps to obtain a plurality of single character extraction images; and finally, splicing the obtained multiple single character extraction images to obtain a whole character extraction image, and inputting the whole character extraction image to an OCR system for recognition.
In implementing the present disclosure, the inventors found that the related art has at least the following problems:
when characters of an object with an uneven surface, such as a bank card or a license plate, are extracted, the gray scale of the image of the object may be unevenly distributed due to the fact that strong reflection and shadow may exist in a protruding area, and therefore when the characters extracted from the image of the object are identified, the identification accuracy is low, and the character extraction method is not universal.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a character extraction method, device and terminal.
According to a first aspect of the embodiments of the present disclosure, there is provided a character extraction method, the method including:
for each pixel point in a target image, selecting a block in the target image by taking the pixel point as a center in one direction of a preset number of directions according to the thickness degree of a character line in the target image;
calculating gradient symmetric correlation degree of each pixel point in the direction according to the pixel value of each pixel point in the block;
and extracting characters in the target image according to the gradient symmetric correlation of each pixel point in the preset number of directions.
Optionally, when the direction is a horizontal right direction of the pixel point, the calculating a gradient symmetric correlation degree of the pixel point in the direction by applying a formula according to a pixel value of each pixel point in the block includes:
wherein H and W are constants, H is the height value of the block, W is the width value of the block, I and j are variables, I belongs to [0, H ], j belongs to [0, W ], H and W are the height value and the width value of the target image respectively, I (I, j), I (I, j-C) and I (I, j + C) are pixel values of pixel points (I, j), (I, j-C) and (I, j + C) respectively, and C (I, j) is the gradient symmetric correlation degree of the pixel points in the direction.
Optionally, the extracting characters from the target image according to the gradient symmetric correlation of each pixel point in the preset number of directions includes:
for one pixel point in a plurality of pixel points, determining the gradient symmetric correlation degree smaller than a first preset threshold value from the gradient symmetric correlation degrees of the pixel points in the preset number of directions;
setting the gradient symmetry degree of correlation smaller than a first preset threshold value to be 0;
determining a neighborhood of the pixel point, and normalizing the gradient symmetric correlation of the pixel point in a preset number of directions according to the gradient symmetric correlation corresponding to the pixel point included in the neighborhood to obtain the normalized gradient symmetric correlation of the pixel point in the preset number of directions;
and extracting characters from the target image according to the normalized gradient symmetric correlation of each pixel point in the preset number of directions.
Optionally, the normalizing the gradient symmetry correlation degrees of the pixel points in the preset number of directions by applying the following formula according to the gradient symmetry correlation degrees corresponding to the pixel points included in the neighborhood includes:
whereinDenotes the normalized gradient symmetric correlation, C, of the pixel points in the x-directionx(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the x direction, Cd(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the direction of d,for normalizing the coefficients, N (i, j) referring to said pixel pointsNeighborhood, D, refers to a set of a preset number of directions.
Optionally, according to the normalized gradient symmetric correlation of each pixel point in the preset number of directions, performing character extraction in the target image, including:
for one pixel point in a plurality of pixel points, calculating the character likelihood of the pixel point according to the normalized gradient symmetric correlation degree of the pixel point in the preset number of directions;
determining each pixel point of which the character likelihood is greater than a second preset threshold in the target image;
and determining the image area with the most gathered pixel points as the area where the character is located in each pixel point with the character likelihood degree larger than a second preset threshold value.
Optionally, the calculating the character likelihood of the pixel point according to the normalized gradient symmetric correlation of the pixel point in the preset number of directions by applying the following formula includes:
wherein P (i, j) is the character likelihood of the pixel point,refers to the largest of the normalized gradient symmetric correlations of the pixel points in a preset number of directions,refers to the smallest of the normalized gradient symmetric correlations of the pixel points in a preset number of directions, σ2Refers to the coefficient of variance.
According to a second aspect of the embodiments of the present disclosure, there is provided a character extraction apparatus, the apparatus including:
the block selection module is used for selecting a block in the target image according to the thickness degree of a character line in the target image by taking the pixel point as a center in one direction of a preset number of directions for each pixel point in the target image;
the correlation calculation module is used for calculating gradient symmetric correlation of the pixel points in the direction according to the pixel values of the pixel points in the block;
and the character extraction module is used for extracting characters in the target image according to the gradient symmetric correlation of each pixel point in the preset number of directions.
Optionally, when the direction is the horizontal right direction of the pixel point, the relevance calculating module calculates the gradient symmetric relevance of the pixel point in the direction by applying the following formula:
wherein H and W are constants, H is the height value of the block, W is the width value of the block, I and j are variables, I belongs to [0, H ], j belongs to [0, W ], H and W are the height value and the width value of the target image respectively, I (I, j), I (I, j-C) and I (I, j + C) are pixel values of pixel points (I, j), (I, j-C) and (I, j + C) respectively, and C (I, j) is the gradient symmetric correlation degree of the pixel points in the direction.
Optionally, the character extraction module includes:
the correlation determination unit is used for determining the gradient symmetric correlation smaller than a first preset threshold value from the gradient symmetric correlation of the pixel points in the preset number of directions for one pixel point in the plurality of pixel points;
the correlation degree assignment unit is used for setting the gradient symmetric correlation degree smaller than the first preset threshold value to be 0;
the normalization processing unit is used for determining a neighborhood of the pixel points, and performing normalization processing on the gradient symmetric correlation degrees of the pixel points in the preset number of directions according to the gradient symmetric correlation degrees corresponding to the pixel points included in the neighborhood to obtain the normalized gradient symmetric correlation degrees of the pixel points in the preset number of directions;
and the character extraction unit is used for extracting characters from the target image according to the normalized gradient symmetric correlation degree of each pixel point in the preset number of directions.
Optionally, the normalization processing module is configured to apply the following formula to normalize the gradient symmetric correlations of the pixel points in the preset number of directions:
whereinDenotes the normalized gradient symmetric correlation, C, of the pixel points in the x-directionx(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the x direction, Cd(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the direction of d,to normalize the coefficients, N (i, j) refers to the neighborhood of the pixel point, and D refers to a set of a preset number of directions.
Optionally, the character extracting unit includes:
the character likelihood degree calculation operator unit is used for calculating the character likelihood degree of a pixel point according to the normalized gradient symmetric correlation degree of the pixel point in the preset number of directions for one pixel point in a plurality of pixel points;
a pixel point determining subunit, configured to determine, in the target image, each pixel point whose character likelihood is greater than a second preset threshold;
and the character area determining subunit is used for determining the image area with the most gathered pixel points as the area where the character is located in each pixel point with the character likelihood degree larger than a second preset threshold value.
Optionally, the character likelihood calculator operator unit calculates the character likelihood of the pixel point by applying the following formula:
wherein P (i, j) is the character likelihood of the pixel point,refers to the largest of the normalized gradient symmetric correlations of the pixel points in a preset number of directions,refers to the smallest of the normalized gradient symmetric correlations of the pixel points in a preset number of directions, σ2Refers to the coefficient of variance.
According to a third aspect of the embodiments of the present disclosure, there is provided a terminal, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: for each pixel point in a target image, selecting a block in the target image by taking the pixel point as a center in one direction of a preset number of directions according to the thickness degree of a character line in the target image; calculating gradient symmetric correlation degree of each pixel point in the direction according to the pixel value of each pixel point in the block; and extracting characters in the target image according to the gradient symmetric correlation of each pixel point in the preset number of directions.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
the method is suitable for not only printed images but also non-printed images such as bank cards or license plates containing convex areas because the method is robust to the large-scale illumination brightness change conditions, and has strong universality.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a schematic diagram illustrating a character grayscale according to an exemplary embodiment.
FIG. 2 is a flow diagram illustrating a method of character extraction according to an example embodiment.
FIG. 3 is a flow diagram illustrating a method of character extraction according to an example embodiment.
FIG. 4 is a schematic illustration of a preset number of directions, according to an exemplary embodiment.
Fig. 5 is a schematic diagram illustrating a character extraction apparatus according to an exemplary embodiment.
Fig. 6 is a block diagram illustrating a terminal according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims. Before explaining the embodiments of the present invention in detail, an application scenario of the embodiments of the present invention will be explained. When extracting characters from non-printed images such as bank cards or license plate images, the characters on the surfaces of the bank cards or the license plates are generally in a convex state, and the convex areas often have strong reflection and shadow, so that the gray scale of the images is uneven, and the accuracy is low when extracting the characters based on the existing character extraction technology. Referring to fig. 1, the right image is a grayscale image of the left image corresponding to the row, and the portion between two dotted lines in the right image is a character line region, so that the visible line region cannot be divided by a fixed threshold. The line area has strong gray scale change due to the influence of the bulge, and shows strong symmetrical extreme values and peak values. Therefore, the embodiment of the invention provides a character extraction technology based on symmetric correlation, which can effectively extract characters of non-print images such as bank cards or license plate images. The specific process is described in detail in the following examples.
Fig. 2 is a flowchart illustrating a character extraction method according to an exemplary embodiment, where the character extraction method is used in a terminal, as shown in fig. 1, and includes the following steps.
In step 201, for each pixel point in the target image, a block is selected in the target image according to the thickness degree of the character line in the target image, with the pixel point as the center, in one of the preset number of directions.
In step 202, a gradient symmetric correlation degree of the pixel points in the direction is calculated according to the pixel value of each pixel point in the block.
In step 203, according to the gradient symmetric correlation of each pixel point in the preset number of directions, extracting characters from the target image.
The method provided by the embodiment of the invention extracts the characters based on the gradient symmetric correlation degrees of all the pixel points in the target image in the preset number of directions, and is robust to the illumination brightness change condition with large scale, so that the method is not only suitable for the print images, but also suitable for non-print images such as bank cards or license plate images containing convex areas, and the character extraction method has strong universality.
Optionally, when the direction is the horizontal right direction of the pixel point, the following formula is applied according to the pixel value of each pixel point in the block, and the gradient symmetric correlation of the pixel point in the direction is calculated, including:
wherein H and W are constants, H is a height value of the block, W is a width value of the block, I and j are variables, I belongs to [0, H ], j belongs to [0, W ], H and W are respectively the height value and the width value of the target image, I (I, j), I (I, j-C) and I (I, j + C) are respectively pixel values of pixel points (I, j), (I, j-C) and (I, j + C), and C (I, j) is gradient symmetric correlation degree of the pixel points in the direction.
Optionally, according to the gradient symmetric correlation of each pixel point in the preset number of directions, performing character extraction in the target image, including:
for one pixel point in the plurality of pixel points, determining the gradient symmetric correlation degree smaller than a first preset threshold value from the gradient symmetric correlation degrees of the pixel points in the preset number of directions;
setting the gradient symmetry degree of correlation smaller than a first preset threshold value to be 0;
determining a neighborhood of the pixel points, and normalizing the gradient symmetric correlation degrees of the pixel points in the preset number of directions according to the gradient symmetric correlation degrees corresponding to the pixel points included in the neighborhood to obtain the normalized gradient symmetric correlation degrees of the pixel points in the preset number of directions;
and extracting characters from the target image according to the normalized gradient symmetric correlation of each pixel point in the preset number of directions.
Optionally, the normalizing the gradient symmetry correlation degrees of the pixel points in the preset number of directions by applying the following formula according to the gradient symmetry correlation degrees corresponding to the pixel points included in the neighborhood includes:
whereinNormalized gradient symmetric correlation, C, of a pixel point in the x-directionx(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the x direction, Cd(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the direction of d,to normalize the coefficients, N (i, j) refers to the neighborhood of a pixel point and D refers to a set of a preset number of directions.
Optionally, according to the normalized gradient symmetric correlation degree of each pixel point in the preset number of directions, performing character extraction in the target image, including:
for one pixel point in the plurality of pixel points, calculating the character likelihood of the pixel point according to the normalized gradient symmetric correlation degree of the pixel point in the preset number of directions;
determining each pixel point of which the character likelihood is greater than a second preset threshold in the target image;
and determining the image area with the most gathered pixel points as the area where the character is located in each pixel point with the character likelihood degree larger than a second preset threshold value.
Optionally, the following formula is applied to calculate the character likelihood of the pixel point according to the normalized gradient symmetric correlation of the pixel point in the preset number of directions, and the method includes:
wherein P (i, j) is the character likelihood of the pixel,refers to the maximum of the normalized gradient symmetric correlation of the pixel points in the preset number of directions,denotes the smallest of the normalized gradient symmetric correlations of the pixel points in the preset number of directions, σ2Refers to the coefficient of variance.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
FIG. 3 is a flow diagram illustrating a method of character extraction according to an example embodiment. The character extraction method provided by the present embodiment will now be explained in detail with reference to the contents of the above embodiments. As shown in fig. 2, the character extraction method is used in a terminal and includes the following steps.
In step 301, for each pixel point in the target image, a block is selected in the target image according to the thickness degree of the character line in the target image, with the pixel point as the center, in one of the preset number of directions.
Wherein a target image refers to an image comprising one or more characters. The target image may be a video frame including a smooth character region in the digital video, or may also be a bank card image or a license plate image including a concave-convex character region, and the like. The method provided by the embodiment can be applied to effectively extract the character area in the target image regardless of whether the target image contains the concave-convex character area. Referring to fig. 4, for a pixel, the predetermined number of directions may be 4 directions of the pixel, such as a horizontal right direction (0.), an upper-right 45-degree direction (45.), a vertical direction (90.), and an upper-left 45-degree direction (135). Of course, the preset number of directions may include other directions besides the 4 directions, which is not specifically limited in this embodiment. The present embodiment is illustrated by taking the preset number of directions as the above 4 directions as an example.
In the embodiment of the present invention, for a pixel point in a target image, when calculating the gradient symmetric correlation of the pixel point in the predetermined number of directions, it is further required to determine a predetermined number of blocks with the pixel point as a center. The determination of the preset number of blocks is based on the following principle: and for one direction in the preset number of directions, determining a block in the direction according to the thickness degree of the character line in the target image. When the character line is thick, determining an image area comprising more pixel points by taking the pixel point as a center, and determining the image area as a block in the direction; when the character line is thin, an image area comprising fewer pixel points is determined by taking the pixel points as the center, and the image area is determined as the block in the direction. Taking the size of the block as h × w as an example, when the character line is thick, the value of w is large, and the block includes many pixel points; when the character line is thinner, the value of w is smaller, and the block comprises fewer pixel points. At 0 as shown in fig. 4. For example, if the pixel (i, j) is centered at 0. A 3 × 5 block is determined in the direction, and the block includes pixels as shown in table 1 below.
TABLE 1
(i-1,j-2) | (i-1,j-1) | (i-1,j) | (i-1,j+1) | (i-1,j+2) |
(i,j-2) | (i,j-1) | (i,j) | (i,j+1) | (i,j+2) |
(i+1,j-2) | (i+1,j-1) | (i+1,j) | (i+1,j+1) | (i+1,j+2) |
As can be seen from table 1, the pixel (i, j) is located at the center of the block. When determining each pixel point contained in the block in other directions, the determination mode is the same as 0. The directions are consistent, and are not described in detail herein. No matter in which direction the block is determined, the center of the block is the pixel point (i, j).
In step 302, according to the pixel value of each pixel point in the block, the gradient symmetric correlation of the pixel point in the direction is calculated.
In the embodiment of the present invention, when the direction is 0. In the direction, the following formula (1) is applied according to the pixel value of each pixel point in the block, and the pixel point is calculated to be 0. Gradient symmetry correlation in direction:
wherein H and W are constants, H is a height value of the block, W is a width value of the block, I and j are variables, I belongs to [0, H ], j belongs to [0, W ], H and W are respectively the height value and the width value of the target image, I (I, j), I (I, j-C) and I (I, j + C) are respectively pixel values of pixel points (I, j), (I, j-C) and (I, j + C), and C (I, j) is that the pixel point is at 0. Gradient symmetry correlation in direction. If the preset number of directions are the 4 directions shown in step 301, the calculation manner of the gradient symmetric correlation degrees in the other three directions is the same as the formula (1), and is not described herein again. The pixel value of each pixel point in the block may be obtained by using related technologies such as matlab program or Opencv program, and the embodiment does not specifically limit the manner of obtaining the pixel value of each pixel point in the block. It should be noted that the values of r and c are positive integers, and if w is a base number, the upper limit of the value of c is w-1/2.
In addition, for each pixel point in the target image, the gradient symmetric correlation of each pixel point in the preset number of directions can be calculated by the methods provided in the above steps 301 and 302. Taking the preset number of directions as 4 directions shown in step 301 as an example, each pixel point corresponds to 4 gradient symmetric correlations. After obtaining the gradient symmetric correlation corresponding to each pixel point in the target image, the extraction of the character region in the target image can be performed according to the following steps 303 to 305. The specific process is described in detail in steps 303 to 305 below.
In step 303, for a pixel point of the plurality of pixel points, determining a gradient symmetric correlation degree smaller than a first preset threshold value from gradient symmetric correlation degrees of the pixel point in a preset number of directions; the gradient symmetry degree of correlation smaller than the first preset threshold value is set to 0.
The size of the first preset threshold may be a numerical value such as 6 or 7, and the size of the first preset threshold is not specifically limited in this embodiment. In the embodiment of the present invention, the determination of the gradient symmetric correlation smaller than the first preset threshold from the gradient symmetric correlations of the pixel point in the preset number of directions is to effectively and accurately extract the character region based on the gradient symmetric correlation. Because the gradient symmetric correlation refers to the correlation degree of pixel values between each pixel point in one pixel point and the adjacent pixel points, the pixel values of each character in the character area generally tend to be consistent. The gradient symmetry degree of correlation tends to be uniform, and the image area with a larger value is likely to be a character area. Therefore, for each pixel point, the gradient symmetric correlation degree smaller than the first preset threshold has no substantial significance for extracting the character region, and even influences the extraction of the character region, so that the gradient symmetric correlation degree smaller than the first preset threshold is set to 0.
It should be noted that, through the processing in step 303, in the gradient symmetric correlation corresponding to each pixel point, the gradient symmetric correlation larger than the first preset threshold value remains unchanged, and the gradient symmetric correlation smaller than the first preset threshold value changes from the original value to 0. After the above processing, before extracting the character region in the target image, in order to ensure that the character extraction method provided in this embodiment is robust to illumination brightness change in a large scale, normalization processing needs to be performed on the gradient symmetric correlation corresponding to each pixel point. The specific process of the normalization process is described in detail in step 304 below.
In step 304, a neighborhood of the pixel point is determined, and the gradient symmetric correlation of the pixel point in the preset number of directions is normalized according to the gradient symmetric correlation corresponding to the pixel point included in the neighborhood, so as to obtain the normalized gradient symmetric correlation of the pixel point in the preset number of directions.
For a pixel point in the target image, the neighborhood of the pixel point refers to a region formed by adjacent pixel points of the pixel point. For example, taking pixel (i, j) as an example, the neighborhood of pixel (i, j) may be a 5 × 5 region centered on pixel (i, j), and the neighborhood includes 24 other pixels besides pixel (i, j) and adjacent to pixel (i, j). Of course, the size of the neighborhood of the pixel point may be other values besides the above values, and the size of the neighborhood of the pixel point is not particularly limited in this embodiment.
In the embodiment of the present invention, the gradient symmetric correlation degrees of each pixel point in the predetermined number of directions are obtained according to the above steps 301 and 302. Therefore, for a pixel point, after the neighborhood of the pixel point is determined, the gradient symmetric correlation of the pixel point in the preset number of directions can be normalized according to the gradient symmetric correlation corresponding to the pixel point included in the neighborhood, and then the normalized gradient symmetric correlation of the pixel point in the preset number of directions can be obtained. According to the gradient symmetric correlation degree corresponding to the pixel points in the neighborhood, the following formula (2) is applied to normalize the gradient symmetric correlation degree of the pixel points in the preset number of directions:
whereinThe normalized gradient symmetric correlation degree of the pixel point in the x direction is referred to; cx(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the x direction; cd(m, n) is a ladder with pixel points (m, n) in the d directionDegree-symmetric correlation;the value of the normalization coefficient can be determined according to the situation or the experience value; n (i, j) refers to the neighborhood of the pixel point, and the size of the neighborhood is also determined according to the situation or experience value; d refers to a set of a preset number of directions, and if the preset number of directions are 4 directions as shown in step 301, D = {0 °,45 °,90 °,135 ° }.
In step 305, according to the normalized gradient symmetric correlation of each pixel point in the preset number of directions, character extraction is performed in the target image.
In the embodiment of the present invention, when extracting characters from a target image according to the normalized gradient symmetric correlation of each pixel point in the preset number of directions, the following method may be adopted:
for one pixel point in the plurality of pixel points, calculating the character likelihood of the pixel point according to the normalized gradient symmetric correlation degree of the pixel point in the preset number of directions; determining each pixel point of which the character likelihood is greater than a second preset threshold in the target image; and determining the image area with the most gathered pixel points as the area where the character is located in each pixel point with the character likelihood degree larger than a second preset threshold value.
The size of the second preset threshold may be a numerical value such as 1 or 10, and the size of the second preset threshold is not specifically limited in this embodiment. Character likelihood, i.e., character likelihood; the character likelihood of each pixel refers to the character likelihood of each pixel, i.e., the degree to which each pixel is likely to be a character. The greater the character likelihood is, the greater the possibility that the pixel point corresponding to the character likelihood is a character is; the smaller the character likelihood is, the less likely it is that a pixel point corresponding to the character likelihood is a character. This step extracts a character region in the target image based on the above principle.
Optionally, the following formula (3) is applied to calculate the character likelihood of the pixel point according to the normalized gradient symmetric correlation of the pixel point in the preset number of directions:
wherein, P (i, j) is the character likelihood of the pixel point;the maximum of the normalized gradient symmetric correlation of the pixel points in the preset number of directions is indicated, and the preset number of directions are taken as the 4 directions shown in step 301 as an example, thenRefers toThe largest of (1);refers to the smallest of the normalized gradient symmetric correlations of the pixel points in the preset number of directions, taking the preset number of directions as the 4 directions shown in step 301 as an example, thenRefers toThe smallest of (1); sigma2Referring to the coefficient of variance, this value may be contingent on an empirical or empirical value.
Optionally, after the character likelihood of each pixel point in the target image is calculated according to the formula (3), the character region in the target image can be extracted according to the value of the character likelihood of each pixel point. When extracting the character region, firstly determining the character likelihood larger than a second preset threshold value in all the character likelihoods; then, determining each pixel point corresponding to the character likelihood degree which is greater than a second preset threshold value; and finally, according to the coordinate values of all the pixel points, determining the region where the pixel points with the maximum character likelihood degree larger than a second preset threshold value are located in the target image, and determining the region as a character region. For an example, assume that a total of 200 pixels for which the character likelihood is greater than the second predetermined threshold is determined. Wherein 180 pixel points are gathered in the same area of the target image, and all the pixel points are close to each other. And the remaining 20 pixels are scattered in the target image. For this situation, when extracting characters from the target image, the region where 180 pixels are gathered is determined as the character region. After the character region is determined, the character region is input to an OCR system, via which characters in the character region are recognized.
It should be noted that, after the character likelihood of each pixel point in the target image is obtained according to the above formula (3), before the character extraction is performed in the target image according to the character likelihood of each pixel point, in order to improve the accuracy of the character extraction, the method provided in this embodiment further includes the following steps of performing post-processing on the character likelihood: firstly, carrying out Gaussian blur on a target image to reduce the noise of the target image and reduce the detail level of the image; then, setting the character likelihood smaller than a third preset threshold value to 0 to filter the noise of the target image; and finally, normalizing the character likelihood of each pixel point to be 0 □ 255 or 0 □ 1, analyzing a connected region of the target image, and further removing a noise region in the target image.
The method provided by the embodiment of the invention extracts the characters based on the gradient symmetric correlation degrees of all the pixel points in the target image in the preset number of directions, is not only suitable for the print images, but also suitable for non-print images such as bank cards or license plate images containing convex areas, and has stronger universality; in the process of extracting characters based on gradient symmetric correlation, the size of the block is adjusted, and the characters of target images containing various thick and thin character lines can be extracted, so that the character extraction mode has high compatibility; in addition, in the process of extracting the characters based on the gradient symmetric correlation degrees, the gradient symmetric correlation degrees are subjected to normalization processing, so that the character extraction mode is robust to the illumination brightness change condition of large scale, the precision rate of character extraction is high, and the recognition rate of subsequent characters is further improved.
Fig. 5 is a schematic diagram illustrating a character extraction apparatus according to an exemplary embodiment. Referring to fig. 5, the apparatus includes a block selection module 501, a correlation calculation module 502, and a character extraction module 503.
The block selection module 501 is configured to select, for each pixel point in the target image, one block in the target image according to the thickness degree of a character line in the target image, with the pixel point as a center in one of the preset number of directions; the relevance calculating module 502 is connected to the block selecting module 501, and is configured to calculate a gradient symmetric relevance of each pixel point in the direction according to the pixel value of each pixel point in the block; the character extraction module 503 is connected to the relevance calculation module 502, and is configured to extract characters from the target image according to the gradient symmetric relevance of each pixel point in the preset number of directions.
Optionally, when the direction is the horizontal right direction of the pixel point, the correlation calculation module calculates the gradient symmetric correlation of the pixel point in the direction by applying the following formula:
wherein H and W are constants, H is a height value of the block, W is a width value of the block, I and j are variables, I belongs to [0, H ], j belongs to [0, W ], H and W are respectively the height value and the width value of the target image, I (I, j), I (I, j-C) and I (I, j + C) are respectively pixel values of pixel points (I, j), (I, j-C) and (I, j + C), and C (I, j) is gradient symmetric correlation degree of the pixel points in the direction.
Optionally, the character extraction module includes:
the correlation determination unit is used for determining the gradient symmetric correlation smaller than a first preset threshold from the gradient symmetric correlations of the pixel points in the preset number of directions for one pixel point in the plurality of pixel points;
the correlation degree assignment unit is used for setting the gradient symmetric correlation degree smaller than a first preset threshold value to be 0;
the normalization processing unit is used for determining the neighborhood of the pixel points, and normalizing the gradient symmetric correlation degrees of the pixel points in the preset number of directions according to the gradient symmetric correlation degrees corresponding to the pixel points included in the neighborhood to obtain the normalized gradient symmetric correlation degrees of the pixel points in the preset number of directions;
and the character extraction unit is used for extracting characters in the target image according to the normalized gradient symmetric correlation degree of each pixel point in the preset number of directions.
Optionally, the normalization processing module is configured to apply the following formula to normalize the gradient symmetric correlations of the pixel points in the preset number of directions:
whereinNormalized gradient symmetric correlation, C, of a pixel point in the x-directionx(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the x direction, Cd(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the direction of d,to normalize the coefficients, N (i, j) refers to the neighborhood of a pixel point and D refers to a set of a preset number of directions.
Optionally, the character extracting unit includes:
the character likelihood degree calculation operator unit is used for calculating the character likelihood degree of a pixel point according to the normalized gradient symmetric correlation degree of the pixel point in the preset number of directions for one pixel point in the plurality of pixel points;
the pixel point determining subunit is used for determining each pixel point of which the character likelihood is greater than a second preset threshold value in the target image;
and the character area determining subunit is used for determining the image area with the most gathered pixel points as the area where the character is located in each pixel point with the character likelihood degree greater than a second preset threshold value.
Optionally, the character likelihood calculation subunit calculates the character likelihood of the pixel point by applying the following formula:
wherein P (i, j) is the character likelihood of the pixel,refers to the maximum of the normalized gradient symmetric correlation of the pixel points in the preset number of directions,denotes the smallest of the normalized gradient symmetric correlations of the pixel points in the preset number of directions, σ2Refers to the coefficient of variance.
The device provided by the embodiment of the invention extracts the characters based on the gradient symmetric correlation degrees of all the pixel points in the target image in the preset number of directions, and is robust to the illumination brightness change condition with large scale, so that the method is not only suitable for the print images, but also suitable for non-print images such as bank cards or license plate images containing convex areas, and the character extraction method has strong universality.
Fig. 6 is a block diagram illustrating a terminal 600 for character extraction according to an example embodiment. For example, the terminal 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and so forth.
Referring to fig. 6, terminal 600 may include one or more of the following components: processing component 602, memory 604, power component 606, multimedia component 606, audio component 610, input/output (I/O) interface 612, sensor component 614, and communication component 616.
The processing component 602 generally controls overall operation of the terminal 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing elements 602 may include one or more processors 620 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate interaction between the multimedia component 606 and the processing component 602.
The memory 604 is configured to store various types of data to support operation at the device 600. Examples of such data include instructions for any application or method operating on terminal 600, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 604 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power component 606 provides power to the various components of terminal 600. Power components 606 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for terminal 600.
The multimedia component 606 includes a screen providing an output interface between the terminal 600 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, multimedia component 606 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 600 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 610 is configured to output and/or input audio signals. For example, the audio component 610 includes a Microphone (MIC) configured to receive external audio signals when the terminal 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 614 includes one or more sensors for providing various aspects of status assessment for the terminal 600. For example, sensor component 614 can detect an open/closed state of device 600, relative positioning of components, such as a display and keypad of terminal 600, position changes of terminal 600 or a component of terminal 600, presence or absence of user contact with terminal 600, orientation or acceleration/deceleration of terminal 600, and temperature changes of terminal 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is configured to facilitate communications between the terminal 600 and other devices in a wired or wireless manner. The terminal 600 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the terminal 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 604 comprising instructions, executable by the processor 620 of the terminal 600 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein, which when executed by a processor of a mobile terminal, enable the mobile terminal to perform a character extraction method, the method comprising:
for each pixel point in the target image, selecting a block in the target image by taking the pixel point as a center in one direction of preset number of directions according to the thickness degree of a character line in the target image;
calculating gradient symmetric correlation degree of the pixel points in the direction according to the pixel value of each pixel point in the block;
and extracting characters in the target image according to the gradient symmetric correlation of each pixel point in the preset number of directions.
Optionally, when the direction is the horizontal right direction of the pixel point, according to the pixel value of each pixel point in the block, applying the following formula to calculate the gradient symmetric correlation of the pixel point in the direction, including:
wherein H and W are constants, H is a height value of the block, W is a width value of the block, I and j are variables, I belongs to [0, H ], j belongs to [0, W ], H and W are respectively the height value and the width value of the target image, I (I, j), I (I, j-C) and I (I, j + C) are respectively pixel values of pixel points (I, j), (I, j-C) and (I, j + C), and C (I, j) is gradient symmetric correlation degree of the pixel points in the direction.
Optionally, according to the gradient symmetric correlation of each pixel point in the preset number of directions, performing character extraction in the target image, including:
for one pixel point in the plurality of pixel points, determining the gradient symmetric correlation degree smaller than a first preset threshold value from the gradient symmetric correlation degrees of the pixel points in the preset number of directions;
setting the gradient symmetry degree of correlation smaller than a first preset threshold value to be 0;
determining a neighborhood of the pixel points, and normalizing the gradient symmetric correlation degrees of the pixel points in the preset number of directions according to the gradient symmetric correlation degrees corresponding to the pixel points included in the neighborhood to obtain the normalized gradient symmetric correlation degrees of the pixel points in the preset number of directions;
and extracting characters from the target image according to the normalized gradient symmetric correlation of each pixel point in the preset number of directions.
Optionally, the normalizing the gradient symmetry correlation degrees of the pixel points in the preset number of directions by applying the following formula according to the gradient symmetry correlation degrees corresponding to the pixel points included in the neighborhood includes:
whereinNormalized gradient symmetric correlation, C, of a pixel point in the x-directionx(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the x direction, Cd(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the direction of d,to normalize the coefficients, N (i, j) refers to the neighborhood of a pixel point and D refers to a set of a preset number of directions.
Optionally, according to the normalized gradient symmetric correlation degree of each pixel point in the preset number of directions, performing character extraction in the target image, including:
for one pixel point in the plurality of pixel points, calculating the character likelihood of the pixel point according to the normalized gradient symmetric correlation degree of the pixel point in the preset number of directions;
determining each pixel point of which the character likelihood is greater than a second preset threshold in the target image;
and determining the image area with the most gathered pixel points as the area where the character is located in each pixel point with the character likelihood degree larger than a second preset threshold value.
Optionally, the following formula is applied to calculate the character likelihood of the pixel point according to the normalized gradient symmetric correlation of the pixel point in the preset number of directions, and the method includes:
wherein P (i, j) is the character likelihood of the pixel,refers to the maximum of the normalized gradient symmetric correlation of the pixel points in the preset number of directions,denotes the smallest of the normalized gradient symmetric correlations of the pixel points in the preset number of directions, σ2Refers to the coefficient of variance.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.
Claims (11)
1. A method of extracting characters, the method comprising:
for each pixel point in a target image, selecting a block in the target image by taking the pixel point as a center in one direction of preset number of directions according to the thickness degree of a character line in the target image, wherein the thicker the character line, the larger the number of pixel points in the block;
calculating gradient symmetric correlation degree of each pixel point in the direction according to the pixel value of each pixel point in the block;
extracting characters from the target image according to the gradient symmetric correlation of each pixel point in the preset number of directions;
when the direction is the horizontal right direction of the pixel point, the following formula is applied according to the pixel value of each pixel point in the block to calculate the gradient symmetric correlation degree of the pixel point in the direction, and the method comprises the following steps:
wherein H and W are constants, H is the height value of the block, W is the width value of the block, I and j are variables, I belongs to [0, H ], j belongs to [0, W ], H and W are the height value and the width value of the target image respectively, I (I, j), I (I, j-C) and I (I, j + C) are pixel values of pixel points (I, j), (I, j-C) and (I, j + C) respectively, and C (I, j) is the gradient symmetric correlation degree of the pixel points in the direction.
2. The method according to claim 1, wherein the extracting characters from the target image according to the gradient symmetric correlation of each pixel point in the preset number of directions comprises:
for one pixel point in a plurality of pixel points, determining the gradient symmetric correlation degree smaller than a first preset threshold value from the gradient symmetric correlation degrees of the pixel points in the preset number of directions;
setting the gradient symmetry degree of correlation smaller than a first preset threshold value to be 0;
determining a neighborhood of the pixel point, and normalizing the gradient symmetric correlation of the pixel point in a preset number of directions according to the gradient symmetric correlation corresponding to the pixel point included in the neighborhood to obtain the normalized gradient symmetric correlation of the pixel point in the preset number of directions;
and extracting characters from the target image according to the normalized gradient symmetric correlation of each pixel point in the preset number of directions.
3. The method according to claim 2, wherein the normalizing the gradient symmetry correlation degrees of the pixel points in the preset number of directions according to the gradient symmetry correlation degrees corresponding to the pixel points included in the neighborhood by applying the following formula comprises:
wherein,refers to the pixel point in the x directionUp normalized gradient symmetric correlation, Cx(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the x direction, Cd(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the direction of d,to normalize the coefficients, N (i, j) refers to the neighborhood of the pixel point, and D refers to a set of a preset number of directions.
4. The method of claim 2, wherein extracting characters from the target image according to the normalized gradient symmetric correlation of each pixel point in the preset number of directions comprises:
for one pixel point in a plurality of pixel points, calculating the character likelihood of the pixel point according to the normalized gradient symmetric correlation degree of the pixel point in the preset number of directions;
determining each pixel point of which the character likelihood is greater than a second preset threshold in the target image;
and determining the image area with the most gathered pixel points as the area where the character is located in each pixel point with the character likelihood degree larger than a second preset threshold value.
5. The method of claim 4, wherein said calculating the character likelihood of said pixel according to the normalized gradient symmetric correlation of said pixel in a predetermined number of directions by applying the following formula comprises:
wherein P (i, j) is the character likelihood of the pixel point,refers to the largest of the normalized gradient symmetric correlations of the pixel points in a preset number of directions,refers to a normalized gradient symmetry phase of the pixel points in a preset number of directionsMinimum in degree of relation, σ2Refers to the coefficient of variance.
6. An apparatus for extracting a character, the apparatus comprising:
the block selection module is used for selecting a block in the target image by taking the pixel point as a center in one direction of preset number of directions for each pixel point in the target image according to the thickness degree of a character line in the target image, wherein the thicker the character line, the more the number of the pixel points in the block is;
the correlation calculation module is used for calculating gradient symmetric correlation of the pixel points in the direction according to the pixel values of the pixel points in the block;
the character extraction module is used for extracting characters from the target image according to the gradient symmetric correlation degrees of all the pixel points in the preset number of directions;
when the direction is the horizontal right direction of the pixel point, the correlation calculation module calculates the gradient symmetric correlation of the pixel point in the direction by applying the following formula:
wherein H and W are constants, H is the height value of the block, W is the width value of the block, I and j are variables, I belongs to [0, H ], j belongs to [0, W ], H and W are the height value and the width value of the target image respectively, I (I, j), I (I, j-C) and I (I, j + C) are pixel values of pixel points (I, j), (I, j-C) and (I, j + C) respectively, and C (I, j) is the gradient symmetric correlation degree of the pixel points in the direction.
7. The apparatus of claim 6, wherein the character extraction module comprises:
the correlation determination unit is used for determining the gradient symmetric correlation smaller than a first preset threshold value from the gradient symmetric correlation of the pixel points in the preset number of directions for one pixel point in the plurality of pixel points;
the correlation degree assignment unit is used for setting the gradient symmetric correlation degree smaller than the first preset threshold value to be 0;
the normalization processing unit is used for determining a neighborhood of the pixel points, and performing normalization processing on the gradient symmetric correlation degrees of the pixel points in the preset number of directions according to the gradient symmetric correlation degrees corresponding to the pixel points included in the neighborhood to obtain the normalized gradient symmetric correlation degrees of the pixel points in the preset number of directions;
and the character extraction unit is used for extracting characters from the target image according to the normalized gradient symmetric correlation degree of each pixel point in the preset number of directions.
8. The apparatus according to claim 7, wherein the normalization processing module normalizes the gradient symmetry correlation of the pixel points in a predetermined number of directions by applying the following formula:
wherein,denotes the normalized gradient symmetric correlation, C, of the pixel points in the x-directionx(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the x direction, Cd(m, n) is the gradient symmetric correlation degree of the pixel point (m, n) in the direction of d,to normalize the coefficients, N (i, j) refers to the neighborhood of the pixel point, and D refers to a set of a preset number of directions.
9. The apparatus of claim 7, wherein the character extraction unit comprises:
the character likelihood degree calculation operator unit is used for calculating the character likelihood degree of a pixel point according to the normalized gradient symmetric correlation degree of the pixel point in the preset number of directions for one pixel point in a plurality of pixel points;
a pixel point determining subunit, configured to determine, in the target image, each pixel point whose character likelihood is greater than a second preset threshold;
and the character area determining subunit is used for determining the image area with the most gathered pixel points as the area where the character is located in each pixel point with the character likelihood degree larger than a second preset threshold value.
10. The apparatus according to claim 9, wherein said character likelihood calculator is configured to calculate the character likelihood of the pixel by applying the following formula:
wherein P (i, j) is the character likelihood of the pixel point,refers to the largest of the normalized gradient symmetric correlations of the pixel points in a preset number of directions,refers to the smallest of the normalized gradient symmetric correlations of the pixel points in a preset number of directions, σ2Refers to the coefficient of variance.
11. A terminal, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: for each pixel point in a target image, selecting a block in the target image by taking the pixel point as a center in one direction of preset number of directions according to the thickness degree of a character line in the target image, wherein the thicker the character line, the larger the number of pixel points in the block; calculating gradient symmetric correlation degree of each pixel point in the direction according to the pixel value of each pixel point in the block; extracting characters from the target image according to the gradient symmetric correlation of each pixel point in the preset number of directions;
when the direction is the horizontal right direction of the pixel point, the following formula is applied according to the pixel value of each pixel point in the block to calculate the gradient symmetric correlation degree of the pixel point in the direction, and the method comprises the following steps:
wherein H and W are constants, H is the height value of the block, W is the width value of the block, I and j are variables, I belongs to [0, H ], j belongs to [0, W ], H and W are the height value and the width value of the target image respectively, I (I, j), I (I, j-C) and I (I, j + C) are pixel values of pixel points (I, j), (I, j-C) and (I, j + C) respectively, and C (I, j) is the gradient symmetric correlation degree of the pixel points in the direction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410127565.6A CN103955684B (en) | 2014-03-31 | 2014-03-31 | character extracting method, device and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410127565.6A CN103955684B (en) | 2014-03-31 | 2014-03-31 | character extracting method, device and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103955684A CN103955684A (en) | 2014-07-30 |
CN103955684B true CN103955684B (en) | 2017-07-28 |
Family
ID=51332959
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410127565.6A Active CN103955684B (en) | 2014-03-31 | 2014-03-31 | character extracting method, device and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103955684B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109032463B (en) * | 2018-07-19 | 2019-11-05 | 掌阅科技股份有限公司 | Take down notes method for deleting, electronic equipment and computer storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6366699B1 (en) * | 1997-12-04 | 2002-04-02 | Nippon Telegraph And Telephone Corporation | Scheme for extractions and recognitions of telop characters from video data |
CN1438605A (en) * | 2003-03-14 | 2003-08-27 | 西安交通大学 | Beer-bottle raised character fetching-identifying hardware system and processing method |
CN101488224A (en) * | 2008-01-16 | 2009-07-22 | 中国科学院自动化研究所 | Characteristic point matching method based on relativity measurement |
CN102354363A (en) * | 2011-09-15 | 2012-02-15 | 西北工业大学 | Identification method of two-dimensional barcode image on high-reflect light cylindrical metal |
CN102822867A (en) * | 2010-03-26 | 2012-12-12 | 波音公司 | Method for detecting optical defects in transparencies |
-
2014
- 2014-03-31 CN CN201410127565.6A patent/CN103955684B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6366699B1 (en) * | 1997-12-04 | 2002-04-02 | Nippon Telegraph And Telephone Corporation | Scheme for extractions and recognitions of telop characters from video data |
CN1438605A (en) * | 2003-03-14 | 2003-08-27 | 西安交通大学 | Beer-bottle raised character fetching-identifying hardware system and processing method |
CN101488224A (en) * | 2008-01-16 | 2009-07-22 | 中国科学院自动化研究所 | Characteristic point matching method based on relativity measurement |
CN102822867A (en) * | 2010-03-26 | 2012-12-12 | 波音公司 | Method for detecting optical defects in transparencies |
CN102354363A (en) * | 2011-09-15 | 2012-02-15 | 西北工业大学 | Identification method of two-dimensional barcode image on high-reflect light cylindrical metal |
Also Published As
Publication number | Publication date |
---|---|
CN103955684A (en) | 2014-07-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3163504B1 (en) | Method, device and computer-readable medium for region extraction | |
US10095949B2 (en) | Method, apparatus, and computer-readable storage medium for area identification | |
EP3163505A1 (en) | Method and apparatus for area identification | |
RU2639668C2 (en) | Method and device for region identification | |
EP3163500A1 (en) | Method and device for identifying region | |
CN107977659B (en) | Character recognition method and device and electronic equipment | |
CN109344832B (en) | Image processing method and device, electronic equipment and storage medium | |
CN106127751B (en) | Image detection method, device and system | |
CN106228556B (en) | image quality analysis method and device | |
CN108062547B (en) | Character detection method and device | |
CN107480665B (en) | Character detection method and device and computer readable storage medium | |
CN104484871B (en) | edge extracting method and device | |
CN107665354B (en) | Method and device for identifying identity card | |
CN105678242B (en) | Focusing method and device under hand-held certificate mode | |
CN106296665B (en) | Card image fuzzy detection method and apparatus | |
CN104899588B (en) | Identify the method and device of the character in image | |
CN103955684B (en) | character extracting method, device and terminal | |
CN116862826A (en) | Printing defect detection method, device, electronic equipment and storage medium | |
CN109002493A (en) | Fingerprint database update method, device, terminal and storage medium | |
CN113255412B (en) | Document image processing method, device and medium | |
CN106126234B (en) | A kind of screen locking method and device | |
CN115565196A (en) | Image processing method, device and equipment | |
CN113869306A (en) | Text positioning method and device and electronic equipment | |
CN106203152A (en) | Image processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |