Summary of the invention
In view of this, a kind of password of being designed to provide of the application determines method and apparatus, for solving the prior art
The low problem of content accuracy in middle identification image.
In a first aspect, the embodiment of the present application, which provides a kind of password, determines method, this method comprises:
Obtain password image and palace table images;
The password image is handled, the keying sequence in the password image is obtained;
The palace table images are handled, the coordinate information of each palace lattice is obtained;
According to the coordinate information of each palace lattice, identifying processing is carried out to the palace table images, obtains the content letter of each palace lattice
Breath;
If obtained current password sequence is not sky, and identical as previous keying sequence, then according in each palace lattice
Hold information, the determining matched palace lattice of current password with the current password sequence, until having determined and current password sequence
In each password match palace lattice.
Optionally, described that the password image is handled, obtain the keying sequence in the password image, comprising:
The password image is formatted;
The tone of password image after adjusting format conversion;
Processing is split to the password image after adjustment tone;
Password is extracted from the password image after dividing processing, obtains keying sequence.
Optionally, described that the palace table images are handled, obtain the coordinate information of each palace lattice, comprising:
Brightness processed is carried out to the palace table images;
Corrosion treatment is carried out to the palace table images after brightness processed;
The corresponding coordinate information of each palace lattice is extracted from the palace table images after corrosion treatment.
Optionally, the coordinate information according to each palace lattice carries out identifying processing to the palace table images, obtains each palace
The content information of lattice, comprising:
According to the coordinate information of each palace lattice, from the palace table images, the corresponding image of each palace lattice is extracted;
It is input to the corresponding image of each palace lattice in preset image recognition model, obtains the content information of each palace lattice.
Optionally, further includes:
If obtained current password sequence is not sky, and different from previous keying sequence, then execute to the palace trrellis diagram
As the step of being handled, obtain the coordinate information of each palace lattice.
Optionally, further includes:
If obtained current password sequence is sky, according to the coordinate information of each palace lattice, from the palace table images, extract
The corresponding image of each palace lattice;
For the corresponding image of each palace lattice, the feature set of the corresponding image of palace lattice is extracted, the feature of the palace lattice is calculated
Collection and the similar features number in the feature set of other each palace lattice, count palace lattice similar features number corresponding with other palace lattice
And value;
It will be determined as password with the smallest palace lattice of value.
Second aspect, the embodiment of the present application provide a kind of password determining device, which includes:
Module is obtained, for obtaining password image and palace table images;
First processing module obtains the keying sequence in the password image for handling the password image;
Second processing module obtains the coordinate information of each palace lattice for handling the palace table images;
Third processing module carries out identifying processing to the palace table images, obtains for the coordinate information according to each palace lattice
The content information of each palace lattice;
Fourth processing module, if the current password sequence for obtaining is not sky, and identical as previous keying sequence, then
According to the content information of each palace lattice, the determining matched palace lattice of current password with the current password sequence, until determination
The complete palace lattice with each password match in current password sequence.
Optionally, the first processing module is specifically used for:
The password image is formatted;
Processing is split to the password image after format conversion;
Password is extracted from the password image after dividing processing, obtains keying sequence.
The third aspect, the embodiment of the present application provide a kind of computer equipment and include memory, processor and be stored in institute
State the computer program that can be run on memory and on the processor, which is characterized in that the processor executes the meter
The step of above method is realized when calculation machine program.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, the computer-readable storage
Computer program is stored on medium, which is characterized in that the above method is executed when the computer program is run by processor
Step.
Password provided by the embodiments of the present application determines method, after the content information for recognizing keying sequence and palace lattice,
Judge whether keying sequence is empty, if obtained current password sequence is not empty, and identical as previous keying sequence, then basis
The content information of each palace lattice, the determining matched palace lattice of current password with current password sequence, until determined with it is current
The palace lattice of each password match in keying sequence.In this way, after getting password image and palace table images, to password image and palace
Table images are identified, after the coordinate information for obtaining palace lattice, are handled palace table images, are obtained the content information of palace lattice,
While improving the recognition speed of recognition code sequence and content information, it is high also to improve accuracy of identification.
To enable the above objects, features, and advantages of the application to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate
Appended attached drawing, is described in detail below.
Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application
Middle attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only
It is some embodiments of the present application, instead of all the embodiments.The application being usually described and illustrated herein in the accompanying drawings is real
The component for applying example can be arranged and be designed with a variety of different configurations.Therefore, below to the application's provided in the accompanying drawings
The detailed description of embodiment is not intended to limit claimed scope of the present application, but is merely representative of the selected reality of the application
Apply example.Based on embodiments herein, those skilled in the art institute obtained without making creative work
There are other embodiments, shall fall in the protection scope of this application.
The embodiment of the present application provides a kind of password and determines method, as shown in Figure 1, this method comprises:
S101 obtains password image and palace table images;
Here, password image and palace table images can be JPG format, BMP format etc., can be obtained by capture apparatus close
Code image and palace table images, capture apparatus can be but not limited to video camera, the calculating equipment with camera function, have camera shooting
The mobile terminal etc. of function;Password image and palace table images can be in the same images, can also be close in different images
There is keying sequence, keying sequence can be Serial No., alphabetical sequence, spy help character string in code image, it is therefore preferable to number
Word sequence, each palace lattice have number, letter, image spcial character etc. in the table images of palace, it is preferable that each palace lattice are with counting
Word.
S102 handles the password image, obtains the keying sequence in the password image;
It is handled to the password image, when obtaining the keying sequence in the password image, comprising the following steps:
The password image is formatted;
The tone of password image after adjusting format conversion;
Processing is split to the password image after adjustment tone;
Password is extracted from the password image after dividing processing, obtains keying sequence.
Here, technology, dividing processing technology and the code extraction technology of format conversion have detailed in the prior art
It introduces, is no longer excessively illustrated herein.
In specific implementation, the password image of BGR mode is converted to the image of HSV mode, wherein BGR mode image
In the corresponding RGB color of each pixel, include form and aspect, brightness, tone etc. in the image of HSV mode, due to password image
In password shown that the password of display is generally red, adjustment HSV mode password image generally by LED array
Tone, brightness, form and aspect etc., to protrude the red tone of password.The password image of adjustment vitta is generally binary map, binary map
Generally black white image, the pixel value of the pixel of white portion image are generally 1, the pixel of the pixel of black portions image
Value generally 0, is split the password image after adjustment tone, segmentation step is as follows.
For each column pixel in the password image after adjustment tone, judge in the column pixel with the presence or absence of pixel value
For the pixel of setting value (e.g., 1), if there is no the pixel that hue value is setting value, the column pixels for the column pixel
It is not belonging to cryptopart;If the adjacent next column pixel of the column pixel, should there are the pixel that hue value is setting value
The adjacent next column pixel of column pixel belongs to cryptopart, using the column pixel as the first line of demarcation;If the column pixel
Point is there are the pixel that hue value is setting value, then the column pixel belongs to cryptopart, if the column pixel is adjacent next
Column pixel is there is no the pixel that hue value is setting value, then the adjacent next column pixel of the column pixel is not belonging to password
Part, using the column pixel as the second line of demarcation, partly belonging between adjacent the first line of demarcation and the second line of demarcation is close
Code part.Wherein, setting value is generally pre-set, due to adjustment tone after password image in each palace lattice part luma compared with
Height, other parts are then black, are followed, and the hue value of palace lattice part is set as 1, and the hue value of rest part is 0.
For every row pixel in the password image after adjustment tone, judge in the row pixel with the presence or absence of hue value
For the pixel of setting value, if the row pixel is the pixel of setting value there is no hue value, which is not belonging to
Cryptopart;If there are the pixel that hue value is setting value, the row pixels for the adjacent next line pixel of the row pixel
The adjacent next line pixel of point belongs to cryptopart, using the row pixel as third line of demarcation;If the row pixel exists
Hue value is the pixel of setting value, then the row pixel belongs to cryptopart, if the adjacent next line pixel of the row pixel
Point is there is no the pixel that hue value is setting value, then the adjacent next line pixel of the row pixel is not belonging to cryptopart,
Using the row pixel as the 4th line of demarcation, cryptography unit is partly belonged between adjacent third line of demarcation and the 4th line of demarcation
Point, password position can be limited by the first line of demarcation, the second line of demarcation, third line of demarcation, the 4th line of demarcation composition divided frame
It sets.Wherein, setting value is generally pre-set, and generally 1.
Password image after dividing in practical applications can refer to Fig. 2, can be by the machine learning that pre-sets
Method is such as supporting vector machine model from extraction password in each divided frame after segmentation, and supporting vector machine model is in the prior art
In have detailed introduction, no longer excessively illustrated herein.
S103 handles the palace table images, obtains the coordinate information of each palace lattice;
It is handled to the palace table images, obtains the coordinate information of each palace lattice, comprising the following steps:
Brightness processed is carried out to the palace table images;
Corrosion treatment is carried out to the palace table images after brightness processed;
The corresponding coordinate information of each palace lattice is extracted from the palace table images after corrosion treatment.
In specific implementation, adjust palace table images brightness, after adjust brightness, to adjust brightness after palace table images into
Row corrosion treatment, in this way, white when the lattice region of palace, the part in non-palace lattice region is then black, and each palace lattice region is general
For quadrangle, e.g., rectangle, square etc., it is therefore preferable to rectangle.
Due in the palace table images of acquisition in addition to nine grids are there may be other rectangles, extracting white area
Coordinate information before, can detecte the area of each rectangular area in the table images of palace, only extract area be greater than setting area threshold
The coordinate information of the rectangular area of value.The coordinate information of extraction is generally two-dimensional coordinate, and each rectangular area is generally corresponding with four
A coordinate information, four coordinate informations are respectively the coordinate information at four angles of rectangle.
When being present in rectangle local similar in the lattice area of palace in the table images of palace, the seat of above-mentioned rectangular area can be also extracted
Information is marked, still, the rectangular area of close area and the spacing of palace lattice can be distant, therefore, after obtaining coordinate information, for
The corresponding coordinate information in each rectangular area, calculates the distance of rectangular area rectangular area adjacent thereto, if the rectangle region
The distance of domain rectangular area adjacent thereto is in set distance range, it is determined that the rectangular area is palace lattice, if the rectangle
There is distance in the distance of region rectangular area adjacent thereto is more than set distance range, it is determined that the rectangular area is not palace
Lattice delete the corresponding coordinate information in the rectangular area, finally, obtain the corresponding coordinate information of nine palace lattice.It can in this way, can use up
The coordinate information of each palace lattice can be obtained, the accuracy for obtaining the coordinate information of each palace lattice is improved, to reduce other similar squares
The influence that shape arrives the coordinate information for extracting palace lattice.
S104 carries out identifying processing to the palace table images, obtains the interior of each palace lattice according to the coordinate information of each palace lattice
Hold information;
In the coordinate information according to each palace lattice, identifying processing is carried out to the palace table images, obtains the content of each palace lattice
Information, comprising the following steps:
According to the coordinate information of each palace lattice, from the palace table images, the corresponding image of each palace lattice is extracted;
It is input to the corresponding image of each palace lattice in preset image recognition model, obtains the content information of each palace lattice.
Here, image recognition model is usually the supporting vector machine model that training is completed in advance, and the application not limits this
System;Content information can be number, additional character, the letter etc. in the lattice of palace.
In specific implementation, after the coordinate information for obtaining nine palace lattice, each palace lattice can be obtained from the table images of palace
The corresponding image of each palace lattice is input to and is previously-completed in trained supporting vector machine model, obtained each by corresponding image
The content information of palace lattice, for example, digital.
S105, if obtained current password sequence is not sky, and identical as previous keying sequence, then according to each palace lattice
Content information, the determining matched palace lattice of current password with the current password sequence, until having determined and current password
The palace lattice of each password match in sequence.
Here, the determining matched palace lattice of current password with the current password sequence, it is, determining current password
Whether the current password in sequence is consistent with the content of palace lattice.
Since, there may be two kinds of situations, situation is first is that keying sequence is number, then corresponding nine palace in practical application
The content of lattice is also number, situation second is that keying sequence is sky, then in nine grids there are the contents of palace lattice and its
The content of its palace lattice is different.
For situation one, after getting keying sequence for the first time, judge whether keying sequence is sky, if keying sequence is not
For sky, then according to the content information of each palace lattice, the determining palace lattice with the first password match in keying sequence aim at determining palace
Lattice simultaneously strike the palace lattice, if the palace lattice of impact are identical as the first password of keying sequence, the password obtained next time is still upper
One keying sequence, if the palace lattice of impact are different from the first password of keying sequence, the password obtained next time be will be updated.
After getting keying sequence for the second time, whether keying sequence and last keying sequence that judgement currently obtains
It is identical, if they are the same, then according to the content information of each palace lattice, determine the palace lattice with the second password match in keying sequence, if
Determining current password (namely second password) matched palace lattice with current password sequence, then aim at and strike the palace
Lattice, until having determined the palace lattice with each password match in current password sequence.Wherein, after the second password password determination side
Formula is identical as the method for determination of second password, is not described one by one.
When judging the keying sequence currently obtained and whether identical last keying sequence, if obtained current password sequence
Column are not sky, and different from previous keying sequence, illustrate that the last palace lattice determined are different from the password in keying sequence, then
The step of execution handles palace table images, obtains the coordinate information of each palace lattice.
In practical applications, it is considered as knowledge when the password of acquisition has only changed one compared with last for situation one
Not mistake is reuptaked password image and is identified.It, may when the password of acquisition and the last password obtained have changed multidigit
It is last time impact mistake caused by either equipment receives signal but do not make a response at the appointed time, at this time no matter in the lattice of palace
Number whether change, will again according to the keying sequence newly obtained sequence strike palace lattice.When acquisition keying sequence with
Last time obtain keying sequence compared to do not change and in the lattice of palace number do not change, it may be possible to recognition speed is fast, and equipment receives
It does not take action also after secondary recognition result, causes the image of camera typing to have not occurred variation or equipment inclined due to shooting
Difference or other situations cause to have reacted but nine grids panel is uninfluenced and change.Due to that can not judge equipment whether
It makes a response, therefore, continues to read image and be identified, do not send data.It, may when the number duplicated in the lattice of palace
Be due to handwritten numeral it is excessively similar caused by identify mistake, or handwritten numeral is unsharp when due to taking the switching of palace lattice
Moment reuptakes image and is identified.When password does not change, number changes in the lattice of palace, it is believed that last time strikes successfully,
Panel has been switched to next bit password, and such case searches next bit password by the number of blows of record Gong Gezhong's
Position exports target palace lattice serial number to equipment.
For situation two, if obtained current password sequence is sky, according to the coordinate information of each palace lattice, from the palace lattice
In image, the corresponding image of each palace lattice is extracted;For the corresponding image of each palace lattice, the feature of the corresponding image of palace lattice is extracted
Collection, calculates the similar features number in the feature set of the palace lattice and the feature set of other each palace lattice, calculates the palace lattice and other palaces
The corresponding similar features number of lattice and value;It will be determined as password with the smallest palace lattice of value.
In specific implementation, after the image for extracting each palace lattice, for the corresponding domestic image of each palace lattice, Jiang Gegong
The image of lattice, which is input to, to be previously-completed in trained image recognition model, and the feature set of the corresponding image of palace lattice is obtained, comparison
The feature set of the palace lattice and feature set with other palace lattice, respectively obtain the similar features number of the palace lattice Yu other palace lattice, count
Calculate the similar features number of the palace lattice and other palace lattice and value.It will be determined as different palace lattice with the smallest palace lattice of value.
For example, the picture material in palace lattice 2 is character image with reference to Fig. 3, the picture material of other palace lattice is automobile figure
Picture, then, the similar features number that palace lattice 2 and other palace lattice are calculated can be fewer, and the similar features number of other palace lattice
Mesh can be relatively more, finally, the palace lattice 2 of calculating and the similar features number of other palace lattice and be worth understand it is very low, it is thus determined that palace lattice 2
For different palace lattice, that is, password palace lattice.
The embodiment of the present application provides a kind of password determining device, as shown in figure 4, the device includes:
Module 41 is obtained, for obtaining password image and palace table images;
First processing module 42 obtains the cipher component in the password image for handling the password image
Column;
Second processing module 43 obtains the coordinate information of each palace lattice for handling the palace table images;
Third processing module 44 carries out identifying processing to the palace table images, obtains for the coordinate information according to each palace lattice
To the content information of each palace lattice;
Fourth processing module 45, if the current password sequence for obtaining is not sky, and identical as previous keying sequence,
Then according to the content information of each palace lattice, the determining matched palace lattice of current password with the current password sequence, until true
The palace lattice with each password match in current password sequence are determined.
Optionally, the first processing module 42 is specifically used for:
The password image is formatted;
The tone of password image after adjusting format conversion;
Processing is split to the password image after adjustment tone;
Password is extracted from the password image after dividing processing, obtains keying sequence.
Optionally, the Second processing module 43 is specifically used for:
Brightness processed is carried out to the palace table images;
Corrosion treatment is carried out to the palace table images after brightness processed;
The corresponding coordinate information of each palace lattice is extracted from the palace table images after corrosion treatment.
Optionally, the third processing module 44 is specifically used for:
According to the coordinate information of each palace lattice, from the palace table images, the corresponding image of each palace lattice is extracted;
It is input to the corresponding image of each palace lattice in preset image recognition model, obtains the content information of each palace lattice.
Optionally, the fourth processing module 45 is also used to:
If obtained current password sequence is not sky, and different from previous keying sequence, then execute to the palace trrellis diagram
As the step of being handled, obtain the coordinate information of each palace lattice.
Optionally, the fourth processing module 45 is also used to:
If obtained current password sequence is sky, according to the coordinate information of each palace lattice, from the palace table images, extract
The corresponding image of each palace lattice;
For the corresponding image of each palace lattice, the feature set of the corresponding image of palace lattice is extracted, the feature of the palace lattice is calculated
Collection and the similar features number in the feature set of other each palace lattice, count palace lattice similar features number corresponding with other palace lattice
And value;
It will be determined as password with the smallest palace lattice of value.
Method is determined corresponding to the password in Fig. 1, and the embodiment of the present application also provides a kind of computer equipments 500, such as Fig. 5
Shown, which includes memory 501, processor 502 and is stored on the memory 501 and can transport on the processor 502
Capable computer program, wherein above-mentioned processor 502 realizes that above-mentioned password determines method when executing above-mentioned computer program.
Specifically, above-mentioned memory 501 and processor 502 can be general memory and processor, do not do have here
Body limits, and when the computer program of 502 run memory 501 of processor storage, is able to carry out above-mentioned password and determines method, from
And solving the problems, such as that the password accuracy in prior art identification image is low, the application is recognizing in keying sequence and palace lattice
After holding information, judge whether keying sequence is empty, if obtained current password sequence is not empty, and with previous keying sequence
It is identical, then according to the content information of each palace lattice, the determining matched palace lattice of current password with current password sequence, until true
The palace lattice with each password match in current password sequence are determined.In this way, after getting password image and palace table images, to close
Code image and palace table images are identified, after the coordinate information for obtaining palace lattice, are handled palace table images, are obtained palace lattice
It is high also to improve accuracy of identification while improving the recognition speed of recognition code sequence and content information for content information.
Method is determined corresponding to the password in Fig. 1, the embodiment of the present application also provides a kind of computer readable storage medium,
It is stored with computer program on the computer readable storage medium, which executes above-mentioned password when being run by processor
The step of determining method.
Specifically, which can be general storage medium, such as mobile disk, hard disk, on the storage medium
Computer program when being run, be able to carry out above-mentioned password and determine method, to solve close in prior art identification image
Whether the low problem of code accuracy, the application judge keying sequence after the content information for recognizing keying sequence and palace lattice
Then believed according to the content of each palace lattice for sky if obtained current password sequence is not sky, and identical as previous keying sequence
Breath, the determining matched palace lattice of current password with current password sequence, until determined with it is each close in current password sequence
The matched palace lattice of code.In this way, password image and palace table images are identified after getting password image and palace table images,
After the coordinate information for obtaining palace lattice, palace table images are handled, obtain the content information of palace lattice, are improving recognition code
While sequence and the recognition speed of content information, it is high also to improve accuracy of identification.
In embodiment provided herein, it should be understood that disclosed system and method, it can be by others side
Formula is realized.System embodiment described above is only schematical, for example, the division of the unit, only one kind are patrolled
Function division is collected, there may be another division manner in actual implementation, in another example, multiple units or components can combine or can
To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some communication interfaces, system or unit
It connects, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
In addition, each functional unit in embodiment provided by the present application can integrate in one processing unit, it can also
To be that each unit physically exists alone, can also be integrated in one unit with two or more units.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product
It is stored in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially in other words
The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a
People's computer, server or network equipment etc.) execute each embodiment the method for the application all or part of the steps.
And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi
It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing, in addition, term " the
One ", " second ", " third " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
Finally, it should be noted that embodiment described above, the only specific embodiment of the application, to illustrate the application
Technical solution, rather than its limitations, the protection scope of the application is not limited thereto, although with reference to the foregoing embodiments to this Shen
It please be described in detail, those skilled in the art should understand that: anyone skilled in the art
Within the technical scope of the present application, it can still modify to technical solution documented by previous embodiment or can be light
It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make
The essence of corresponding technical solution is detached from the spirit and scope of the embodiment of the present application technical solution.The protection in the application should all be covered
Within the scope of.Therefore, the protection scope of the application shall be subject to the protection scope of the claim.