Summary of the invention
In view of this, the embodiment of the present invention provides a kind of character image recognition methods and device, to solve existing text figure
The identification accuracy as present in identification method is lower, the higher problem of computation complexity.
To achieve the above object, the embodiment of the present invention provides the following technical solutions:
A kind of character image recognition methods is applied to electronic equipment, which comprises
Obtain images to be recognized;
Determine the full figure characteristic parameters of spectra of the images to be recognized;
If the full figure characteristic parameters of spectra is greater than threshold value, it is determined that the images to be recognized is character image.
Wherein, the acquisition images to be recognized includes:
The viewfinder image is determined as figure to be identified by the viewfinder image for obtaining the image collecting device of the electronic equipment
Picture;
Or, obtain image captured by the image collecting device of the electronic equipment, by captured image be determined as to
Identify image;
Or, transferring the image that the electronic equipment is locally stored, the image being locally stored transferred is determined as wait know
Other image;
Or, obtaining the image that the electronic equipment is downloaded from network, the image downloaded is determined as images to be recognized.
Wherein, the full figure characteristic parameters of spectra of the determination images to be recognized includes:
Multiple detection zones are chosen from the images to be recognized;
FTF transformation is carried out to each detection zone respectively, obtains the corresponding spectral characteristic figure of each detection zone;
Determine the maximum frequency of each spectral characteristic figure;
It carries out the maximum frequency of each spectral characteristic figure to take average value processing, obtains means frequency, the means frequency is true
It is set to the full figure characteristic parameters of spectra.
Wherein, described to choose multiple detection zones from the images to be recognized and include:
According to the resolution ratio of the images to be recognized and the resolution ratio of the detection zone of setting, the multiple detection zone is determined
Line number and columns of the domain in the images to be recognized;
The images to be recognized is divided into corresponding the multiple detection zone with the line number and columns, sampling is drawn
Each detection zone divided.
Wherein, the maximum frequency of each spectral characteristic figure of the determination includes:
By the DC component zero setting of each spectral characteristic figure;
Each spectral characteristic figure after DC component zero setting is normalized;
The maximum frequency of each spectral characteristic figure after determining normalized.
Wherein, the full figure characteristic parameters of spectra of the determination images to be recognized includes:
FTF transformation is carried out to the images to be recognized, obtains the spectral characteristic figure of the images to be recognized;
The maximum frequency of the spectral characteristic figure of the images to be recognized is determined as the full figure characteristic parameters of spectra.
The embodiment of the present invention also provides a kind of character image identification device, is applied to electronic equipment, and described device includes:
Module is obtained, for obtaining images to be recognized;
Characteristic value determining module, for determining the full figure characteristic parameters of spectra of the images to be recognized;
Determining module is identified, if being greater than threshold value for the full figure characteristic parameters of spectra, it is determined that the images to be recognized is
Character image.
Wherein, the characteristic value determining module includes:
Selection unit, for choosing multiple detection zones from the images to be recognized;
First converter unit obtains the corresponding frequency spectrum of each detection zone for carrying out FTF transformation to each detection zone respectively
Performance plot;
First frequency determination unit, for determining the maximum frequency of each spectral characteristic figure;
Mean value determination unit obtains means frequency for carrying out the maximum frequency of each spectral characteristic figure to take average value processing,
The means frequency is determined as the full figure characteristic parameters of spectra.
Wherein, the selection unit includes:
Ranks determine subelement, for the resolution according to the detection zone of the resolution ratio and setting of the images to be recognized
Rate determines line number and columns of the multiple detection zone in the images to be recognized;
Sampling subelement is divided, it is corresponding described more for being divided into the images to be recognized with the line number and columns
A detection zone samples each detection zone divided.
Wherein, the first frequency determination unit includes:
Zero setting subelement, for by the DC component zero setting of each spectral characteristic figure;
Normalizing subelement, for each spectral characteristic figure after DC component zero setting to be normalized;
Maximum frequency determines subelement, for determining the maximum frequency of each spectral characteristic figure after normalized.
Based on the above-mentioned technical proposal, character image recognition methods provided in an embodiment of the present invention is obtaining images to be recognized
Afterwards, it may be determined that the full figure characteristic parameters of spectra of images to be recognized, and when the full figure characteristic parameters of spectra is greater than threshold value, described in determination
Images to be recognized is character image, realizes the identification of character image.Since character image has significant frequency domain characteristic, this
The character image recognition methods that inventive embodiments provide carries out character image by the full figure characteristic parameters of spectra of images to be recognized
Identification, identification accuracy with higher, and due to not using complicated algorithm to realize the identification of character image, character image
The computation complexity of identification is lower.It can be seen that character image recognition methods provided in an embodiment of the present invention, be based on character image
Frequency domain characteristic realize the identification of character image, compared with prior art identification accuracy with higher, and computation complexity compared with
It is low.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
The inventors of the present invention discovered through researches that the image based on text, since the size of text, arrangement are all with stronger
Regularity, therefore its frequency domain characteristic is significant;And for other kinds of image (such as landscape image), frequency domain distribution phase
Comparing character image is more low frequency region;Therefore the embodiment of the present invention can be by carrying out frequency-domain analysis to image, to identify
Image is character image or non-legible image;If being applied to scene of taking pictures, then current scene of taking pictures can be distinguished as text
Word scene or non-legible scene.
Fig. 1 is the flow chart of character image recognition methods provided in an embodiment of the present invention, and this method can be applied to electronics and set
It is standby, the electronic equipment can be mobile phone, tablet computer, laptop etc. have data-handling capacity equipment, further,
The electronic equipment can be the electronic equipment with image collecting device (such as camera);Referring to Fig.1, this method may include:
Step S100, images to be recognized is obtained;
The image that images to be recognized can obtain for any way, as electronic equipment is using image collecting device to carry out
It takes pictures, then images to be recognized can be the current viewfinder image of image collecting device or the image that has shot;Obviously, of the invention
Embodiment can also locally save electronic equipment or identify that then images to be recognized can be institute from the image that network obtains
The electronic equipment local image transferred or the image downloaded from network.
Specifically, the embodiment of the present invention can obtain the viewfinder image of the image collecting device of the electronic equipment, it will be described
Viewfinder image is determined as images to be recognized;
Or, obtain image captured by the image collecting device of the electronic equipment, by captured image be determined as to
Identify image;
Or, transferring the image that the electronic equipment is locally stored, the image being locally stored transferred is determined as wait know
Other image;
Or, obtaining the image that the electronic equipment is downloaded from network, the image downloaded is determined as images to be recognized.
It should be noted that the explanation of above-mentioned images to be recognized is only for example formula explanation, the image that other modes obtain
It can be used as the images to be recognized of the embodiment of the present invention.
Step S110, the full figure characteristic parameters of spectra of the images to be recognized is determined;
Optionally, FFT (Fast Fourier Transformation, fast Fourier change can be used in the embodiment of the present invention
Change) transformation algorithm, determine the full figure characteristic parameters of spectra of images to be recognized;Obviously, FFT transform algorithm is only that one kind obtains full figure frequency
Other algorithms that image frequency domain characteristic can be obtained can also be used in the optional way of spectroscopic eigenvalue, the embodiment of the present invention.
The embodiment of the present invention determine the full figure characteristic parameters of spectra of images to be recognized a kind of mode be to images to be recognized into
Row FFT transform obtains the spectral characteristic figure of images to be recognized, so that it is determined that the maximum frequency of spectral characteristic figure, by maximum frequency
Full figure characteristic parameters of spectra of the rate as images to be recognized;Although this mode is directly simple, identified full figure spectrum signature
There are certain errors for value;Another way provided in an embodiment of the present invention are as follows:
Detection zone division is carried out to images to be recognized, FTF transformation is carried out to each detection zone, obtains each detection zone pair
The spectral characteristic figure answered, to carry out the maximum frequency of each spectral characteristic figure to take average value processing, the means frequency obtained is made
For the full figure characteristic parameters of spectra.
If step S120, the described full figure characteristic parameters of spectra is greater than threshold value, it is determined that the images to be recognized is character image.
What threshold value indicated is full figure characteristic parameters of spectra corresponding to character image, can be according to the complete of calculating kinds of words image
After figure characteristic parameters of spectra, mean value is taken to obtain.
Character image recognition methods provided in an embodiment of the present invention, after obtaining images to be recognized, it may be determined that figure to be identified
The full figure characteristic parameters of spectra of picture, and when the full figure characteristic parameters of spectra is greater than threshold value, determine that the images to be recognized is text
Image realizes the identification of character image.It is provided in an embodiment of the present invention since character image has significant frequency domain characteristic
Character image recognition methods carries out the identification of character image by the full figure characteristic parameters of spectra of images to be recognized, with higher
Identify accuracy, and due to not using complicated algorithm to realize that the identification of character image, the calculating of character image identification are complicated
It spends lower.It can be seen that character image recognition methods provided in an embodiment of the present invention, the frequency domain characteristic based on character image is realized
The identification of character image, identification accuracy with higher compared with prior art, and computation complexity is lower.
Optionally, the embodiment of the present invention can call character image corresponding after determining that images to be recognized is character image
Processing Algorithm handles the images to be recognized, to optimize the imaging effect of the images to be recognized.
Fig. 2 is another flow chart of character image recognition methods provided in an embodiment of the present invention, and referring to Fig. 2, this method can
To include:
Step S200, images to be recognized is obtained;
Step S210, multiple detection zones are chosen from the images to be recognized;
Optionally, the embodiment of the present invention can choose multiple detection zones from images to be recognized at random;
Optionally, it is required since FFT transform has image resolution ratio, the embodiment of the present invention can set detection zone
The resolution ratio of the resolution ratio in domain, set detection zone should at least meet requirement of the FFT transform for image resolution ratio;To
Using the resolution ratio of the detection zone of setting as the resolution ratio of selected each detection zone, according to the resolution ratio of images to be recognized
And setting detection zone resolution ratio, it may be determined that images to be recognized can divided detection zone quantity, thus to be identified
Multiple detection zones are selected in image;
Specifically, the embodiment of the present invention can according to the resolution ratio of the detection zone of the resolution ratio and setting of images to be recognized,
Line number and columns of the multiple detection zone in the images to be recognized are determined, thus will be described with the line number and columns
Images to be recognized is divided into corresponding the multiple detection zone, samples each detection zone divided, realizes from described wait know
Multiple detection zones are chosen in other image.For example, when FFT transform, it is desirable that the resolution ratio of image-region is 2n, determining wait know
After the resolution ratio of other image, then it can determine the detection zone quantity that images to be recognized can divide, and then can determine the multiple
Line number and columns of the detection zone in the images to be recognized, are adopted to line number and the ready-portioned detection zone of columns
Sample then can be achieved to choose multiple detection zones from the images to be recognized.
For ease of understanding, Fig. 3 shows the schematic diagram for choosing detection zone, and referring to Fig. 3, figure a is acquired to be identified
Image, the embodiment of the present invention can be determined the multiple with the resolution ratio of images to be recognized and the resolution ratio of the detection zone of setting
Line number and columns of the detection zone in the images to be recognized are 3*3, and then are divided into 9 detection zones for a is schemed with 3*3,
Each detection zone divided is sampled, realizes the selection of multiple detection zones.
Step S220, FTF transformation is carried out to each detection zone respectively, obtains the corresponding spectral characteristic figure of each detection zone;
Step S230, the maximum frequency of each spectral characteristic figure is determined;
Optionally, the maximum frequency of identified each spectral characteristic figure can be that DC component is removed in each spectral characteristic figure
The outer maximum frequency of energy;Corresponding, the embodiment of the present invention can be after obtaining the corresponding spectral characteristic figure of each detection zone, will be each
The DC component zero setting of spectral characteristic figure each spectral characteristic figure after DC component zero setting is normalized, thus really
The maximum frequency of each spectral characteristic figure after determining normalized.
Step S240, it carries out the maximum frequency of each spectral characteristic figure to take average value processing, obtains means frequency, it will be described equal
Value frequency is determined as the full figure characteristic parameters of spectra;
If step S250, the described full figure characteristic parameters of spectra is greater than threshold value, it is determined that the images to be recognized is character image.
Optionally, if the full figure characteristic parameters of spectra is not more than threshold value, it is determined that the images to be recognized is non-legible figure
Picture.
One application of method shown in Fig. 2 are as follows: when mobile phone camera shoots character image, the embodiment of the present invention can be used
Provided character image recognition methods carries out the identification of character image, so that corresponding image processing algorithm be called to carry out text
Image procossing optimizes the imaging effect of character image.
Fig. 4 shows an application schematic diagram, and when the camera of mobile phone shoots image, the processing chip built in mobile phone can be obtained
Camera acquired image is taken, multiple detection zones are chosen from the image, FTF transformation is carried out to each detection zone respectively,
Obtain the corresponding spectral characteristic figure of each detection zone;By each DC component zero setting by spectral characteristic figure, by DC component zero setting
Each spectral characteristic figure afterwards is normalized, the maximum frequency of each spectral characteristic figure after determining normalized;It will be each
The maximum frequency of spectral characteristic figure carries out taking average value processing, obtains means frequency;Judge whether the means frequency is greater than threshold value, and
When being greater than threshold value, determine that the image of mobile phone camera current shooting is character image, to call at corresponding character image
Adjustment method optimizes processing to captured character image, improves the imaging effect of character image.
Obviously, character image recognition methods provided by the embodiment of the present invention, can also be to electronic equipment locally stored image
Or network downloading image is identified.
Fig. 5 shows another flow chart of character image recognition methods provided in an embodiment of the present invention, referring to Fig. 5, the party
Method may include:
Step S300, images to be recognized is obtained;
Step S310, FTF transformation is carried out to the images to be recognized, obtains the spectral characteristic figure of the images to be recognized;
Step S320, the maximum frequency of the spectral characteristic figure of the images to be recognized is determined as the full figure spectrum signature
Value;
Optionally, the embodiment of the present invention can determine in the spectral characteristic figure of images to be recognized, and energy is most in addition to DC component
Big frequency is the full figure characteristic parameters of spectra;Specifically, the embodiment of the present invention can be by the spectral characteristic figure of images to be recognized
The spectral characteristic figure of images to be recognized after DC component zero setting is normalized, determines normalizing by DC component zero setting
Change the maximum frequency of the spectral characteristic figure of treated images to be recognized.
If step S330, the described full figure characteristic parameters of spectra is greater than threshold value, it is determined that the images to be recognized is character image.
Optionally, if the full figure characteristic parameters of spectra is not more than threshold value, it is determined that the images to be recognized is non-legible figure
Picture.
Compared to method shown in Fig. 2, method shown in Fig. 5, which is used, carries out FTF transformation to whole images to be recognized, with to be identified
The maximum frequency of the spectral characteristic figure of image is as the full figure characteristic parameters of spectra, to carry out image frequency domain characteristic and text figure
As the judgement comparison of frequency domain characteristic, the identification of character image is realized.Although method shown in Fig. 5 is more simple, its accuracy is slightly
Lower than method shown in Fig. 2.
It is worth noting that, no matter method shown in method and Fig. 5 shown in Fig. 2 be all based on character image frequency domain characteristic it is real
Existing character image identification, is the optional implementation of method shown in Fig. 1.
One application of method shown in Fig. 5 are as follows: when the camera of mobile phone shoots image, the processing chip built in mobile phone can be obtained
Camera acquired image is taken, FTF transformation is carried out to the image, the spectral characteristic figure of the image is obtained, to the spectral characteristic
The DC component zero setting of figure the spectral characteristic figure after DC component zero setting is normalized, after determining normalized
Spectral characteristic figure maximum frequency, judge whether the maximum frequency is greater than threshold value, and when being greater than threshold value, determine cell-phone camera
Head current shooting image be character image, thus call corresponding character image Processing Algorithm to captured character image into
Row optimization processing improves the imaging effect of character image.
Obviously, character image recognition methods provided by the embodiment of the present invention, can also be to electronic equipment locally stored image
Or network downloading image is identified.
Character image recognition methods provided in an embodiment of the present invention, the frequency domain characteristic based on character image realize character image
Identification, identification accuracy with higher compared with prior art, and computation complexity is lower.
Character image identification device provided in an embodiment of the present invention is introduced below, character image described below is known
Other device can correspond to each other reference with above-described character image recognition methods.
Fig. 6 is the structural block diagram of character image identification device provided in an embodiment of the present invention, the text pattern recognition device
It can be applied to electronic equipment, which can be mobile phone, and tablet computer, laptop etc. is with data-handling capacity
Equipment, further, the electronic equipment can be the electronic equipment with image collecting device (such as camera);It, should referring to Fig. 6
Character image identification device may include:
Module 100 is obtained, for obtaining images to be recognized;
Characteristic value determining module 200, for determining the full figure characteristic parameters of spectra of the images to be recognized;
Determining module 300 is identified, if being greater than threshold value for the full figure characteristic parameters of spectra, it is determined that the images to be recognized
For character image.
Optionally, obtaining module 100 can be specifically used for obtaining the viewfinder image of the image collecting device of the electronic equipment,
The viewfinder image is determined as images to be recognized;Or, image captured by the image collecting device of the electronic equipment is obtained,
Captured image is determined as images to be recognized;Or, the image that the electronic equipment is locally stored is transferred, the sheet that will be transferred
The image of ground storage is determined as images to be recognized;Or, the image that the electronic equipment is downloaded from network is obtained, the figure that will be downloaded
As being determined as images to be recognized.
Optionally, if identification determining module 300 can also be used in the full figure characteristic parameters of spectra no more than threshold value, it is determined that institute
Stating images to be recognized is non-legible image.
Optionally, Fig. 7 shows another structural block diagram of character image identification device provided in an embodiment of the present invention, in conjunction with
Shown in Fig. 6 and Fig. 7, which can also include:
Image processing module 400, for calling character image to locate accordingly after determining that images to be recognized is character image
Adjustment method, handles images to be recognized, to optimize the imaging effect of images to be recognized.
Optionally, Fig. 8 shows a kind of alternative construction of characteristic value determining module 200 provided in an embodiment of the present invention, ginseng
According to Fig. 8, characteristic value determining module 200 may include:
Selection unit 210, for choosing multiple detection zones from the images to be recognized;
It is corresponding to obtain each detection zone for carrying out FTF transformation to each detection zone respectively for first converter unit 211
Spectral characteristic figure;
First frequency determination unit 212, for determining the maximum frequency of each spectral characteristic figure;
Mean value determination unit 213 obtains mean value frequency for carrying out the maximum frequency of each spectral characteristic figure to take average value processing
The means frequency is determined as the full figure characteristic parameters of spectra by rate.
Optionally, Fig. 9 shows a kind of alternative construction of selection unit 210 provided in an embodiment of the present invention, referring to Fig. 9,
Selection unit 210 may include:
Ranks determine subelement 2101, for point according to the detection zone of the resolution ratio and setting of the images to be recognized
Resolution determines line number and columns of the multiple detection zone in the images to be recognized;
Sampling subelement 2102 is divided, for the images to be recognized to be divided into corresponding institute with the line number and columns
Multiple detection zones are stated, each detection zone divided is sampled.
Optionally, selection unit 210 can also be used to choose multiple detection zones from the images to be recognized at random.
Optionally, Figure 10 shows a kind of alternative construction of first frequency determination unit 212 provided in an embodiment of the present invention,
Referring to Fig.1 0, first frequency determination unit 212 may include:
Zero setting subelement 2121, for by the DC component zero setting of each spectral characteristic figure;
Normalizing subelement 2122, for each spectral characteristic figure after DC component zero setting to be normalized;
Maximum frequency determines subelement 2123, for determining the maximum frequency of each spectral characteristic figure after normalized.
Optionally, Figure 11 shows another alternative construction of characteristic value determining module 200 provided in an embodiment of the present invention,
Referring to Fig.1 1, characteristic value determining module 200 may include:
Second converter unit 220 carries out FTF transformation to the images to be recognized, obtains the frequency spectrum of the images to be recognized
Performance plot;
Second frequency determination unit 221, for the maximum frequency of the spectral characteristic figure of the images to be recognized to be determined as
The full figure characteristic parameters of spectra.
Optionally, second frequency determination unit 221 can also have structure shown in Figure 10, and zero setting subelement specifically can be used will
The DC component zero setting of the spectral characteristic figure of images to be recognized, using normalizing subelement by the figure to be identified after DC component zero setting
The spectral characteristic figure of picture is normalized, and the figure to be identified after subelement determines normalized is determined using maximum frequency
The maximum frequency of the spectral characteristic figure of picture.
A kind of electronic equipment can also be provided in the embodiment of the present invention, which may include character image described above
Identification device.Character image identification device pair described above can be used when using camera shooting image in the electronic equipment
Captured image carries out character image identification, so that electronic equipment can after recognizing captured image and being character image
It calls corresponding image processing algorithm to optimize processing to captured image, improves the imaging effect of captured image.
It is with higher compared with prior art the present invention is based on the identification that the frequency domain characteristic of character image realizes character image
Identify accuracy, and computation complexity is lower.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other
The difference of embodiment, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment
For, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is said referring to method part
It is bright.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure
And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These
Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession
Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered
Think beyond the scope of this invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor
The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.