Specific implementation mode
To keep the purpose, technical scheme and advantage of the application clearer, below in conjunction with the application specific embodiment and
Technical scheme is clearly and completely described in corresponding attached drawing.Obviously, described embodiment is only the application one
Section Example, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not doing
Go out the every other embodiment obtained under the premise of creative work, shall fall in the protection scope of this application.
In one or more embodiments of this specification, the target image content that processing is identified is needed, it is believed that
It is a kind of texture, structure, the more easy logo of pattern, figure or pattern.In order to more efficiently be directed to above-mentioned target figure
As content is identified, therefore a kind of image-recognizing method is proposed in this specification embodiment.
The framework being applied to as shown in Figure 1 by the image-recognizing method in this specification embodiment.In Fig. 1:
Server is regarded as the service server on business provider backstage, for ease illustration and understanding, in Fig. 1 only with
One server indicates, but distributed, concentrating type framework may be used in its specific framework, or is only single large-scale service
Device etc. will usually be determined as which kind of framework used according to the needs of practical application.In practical applications, business provider
By the service server, (hereinafter referred to as service customer end used in a large number of users:Client) business service is provided.
In this specification embodiment, server can train to obtain corresponding image recognition model using summary image.The image is known
After other model is reached the standard grade and (can be usually embedded in client), it is (especially simple that the object that client is scanned/shot can be directed to
Image) more accurately identified.
Client operates on terminal device used by a user, built-in in the client in a kind of usual embodiment
There is the image recognition model that above-mentioned training obtains.So, when user is scanned/is shot by the client, the client
Just the object (especially summary image) that scanning or shooting can be directed to carries out image recognition.Certainly, what needs to be explained here is that,
Client described in this specification embodiment is scanned/shoots, it is thus understood that is on client call terminal device
Picture pick-up device (such as:Camera) it is scanned/shoots.It is follow-up to occur then no longer excessively being repeated similar to description.
Based on framework shown in FIG. 1, the image-recognizing method in this specification embodiment is described in detail below.Tool
Body includes the following steps as shown in Fig. 2, for image-recognizing method in this specification embodiment:
Step S201:Obtain original image, wherein include target image content in the original image.
In practical applications, it needs to be trained for image recognition model, whether which can be more
The object that accurately user is scanned/shot is identified, and is often influenced by its training sample.Therefore, after in order to ensure
The accuracy for the image recognition model that continuous training obtains includes mark in this specification embodiment, in the original image
Accurate target image content, such as:One width includes the rendering figure of standard logo, and wherein the rendering figure can be considered original graph
Picture, logo can be considered target image content.
In this specification embodiment, the original image can be the rendering generated by image processing software
Figure can also be by shooting obtained photo, to this without limiting.In general, including target image content
In original image, angle, coloration, the clarity etc. of target image content are kept compared with the figure of merit, and picture noise keeps lower value,
To be subsequently trained as sample.
Step S203:Multiplication processing is carried out according to the target image content, generates multiple changing images.
In practical applications, the image that user is scanned/shot using client may be by angle, focusing, illumination etc.
The influence of a variety of conditions, this undoubtedly increases the difficulty that the image captured by user is identified.So, in order to ensure to be directed to
The accuracy that image captured by user is identified, therefore in this specification embodiment, target image content can be directed to and carried out
Multiplication is handled.
In this specification embodiment, multiplication processing may include the multiplication of projective transformation, display effect times
The multiplication that increasing and/or background are replaced.After multiplication is handled, the image after capable of largely being converted also increases follow-up
The quantity of training sample.
It should be noted that carry out multiplication processing to target image content, can simulate in actual scanning/shooting obtained by
The image arrived.It is appreciated that multiplication processing can expand the quantity of training sample, the quantity for the changing image that doubles is more
(that is, training samples number is bigger) also gets over the image of closing to reality scanning/shooting, and correspondingly, training result is also more accurate
Really.
Step S205:The background is replaced into image and carries out model training as training sample, obtains image recognition model,
To be identified for the images to be recognized comprising target image content.
In view of in practical applications, the logo captured by user may only account for a part for whole image, it is possible to
Using the algorithm of target detection model based on deep learning, as the image recognition model in this specification embodiment.Specifically such as:
The identification models such as Faster-RCNN, YOLO, SSD.Certainly, here and without specifically limiting.
Under practical application scene, the image recognition model obtained by training can be applied in corresponding client,
So, for user when being scanned/being shot using client, which can be directed to the letter for scanning/taking
Easy image is identified.
Through the above steps, in order to effectively identifying that texture, structure, pattern are more easy in practical applications
The target images content such as logo, figure or pattern, server can obtain the original image for including target image content.In view of use
Family may be influenced in actual scanning/photographic subjects picture material by a variety of conditions such as shooting angle, focusing, illumination,
Therefore multiplication processing can be carried out for target image content in this specification embodiment, multiplication processing can be directed to target image
Content carries out the conversion process of different modes, and obtains a large amount of changing image, to expand the quantity of training sample.Into one
Step can promote the recognition accuracy of image recognition model.
For the above method in this specification embodiment, train obtained image recognition model to easy mesh
The discrimination of logo image content is higher, can be with needle in the case of being scanned/shot using client especially for a large number of users
A large amount of easy target image content is accurately identified.
It is directed to above-mentioned image-recognizing method as shown in Figure 2, in one or more embodiments of this specification, is had more
For specific implementation procedure.It is further illustrated below (in the following embodiments, by target image content by taking logo as an example).
Specifically, the execution framework of above-mentioned image-recognizing method in practical applications can be as shown in Figure 3.In figure 3:
One, it is labeled for logo
In practical applications, for the original image comprising logo, logo only accounts for the part in the image, image
Rest part may be blank, in order to accurately determine logo and its type, in the present embodiment, logo can be directed into rower
Note.As a kind of mode of the present embodiment, in the mark stage, it is defeated for logo institutes that server can receive corresponding business personnel
The tab area and markup information entered.Wherein, the tab area can be the region of frame choosing, such as:Rectangle frame, circular frame
Deng, include usually, in tab area logo, and the image other than tab area is regarded as useless image-region.Institute
The markup information stated may include classification information, name information of logo etc..Such as:As shown in figure 4, it is directed to a certain logo, clothes
Business device receives the input of business personnel, rectangle frame is shown on the picture comprising the logo, the region in frame is exactly marked area
Domain.
For the logo after mark, markup information can be recorded in the filename of the logo images, it is of course also possible to
It is recorded in the configuration file to match with the logo images.For the record of markup information, it is not especially limited here.Ying Li
The markup information of solution, logo will follow logo images to be used as training sample to carry out model training together.
Two, Background valut
In practical applications, for the source of background picture, can captured by user/picture of scanning, or be based on
Web crawlers technology crawls etc. for picture materials website, can further establish Background valut.
Three, image multiplication is handled
In the present embodiment, can transformation multiplication processing be carried out to image in the following areas.
1, Geometric projection:Standard logo images are typically orthographic view.But user in actual scanning/shooting compared with
To be random, certain shooting angle is often all carried.Therefore the shooting effect for analog subscriber under certain angle, for standard
The orthographic view of logo carries out projective transformation processing.
In a kind of mode of the present embodiment, it may be used and singly answer projective transformation, that is, using following formula:
As it can be seen that homography matrix is decomposed into join matrix other than internal reference Matrix Multiplication, therefore internal reference matrix and/or outer can be adjusted
Join the parameter value in matrix, generates corresponding homography matrix, and different homography matrixs corresponds to different projection angles, to
The projected image of different angle can further be obtained.As shown in figure 5, the logo of orthographic projection after projective transformation, can become
The projection of respective angles.
In the another way of the present embodiment, radiation transformation may be used, that is, using following formula:
It is similar with aforesaid way, it can equally adjust corresponding matrix parameter and carry out projective transformation, it is just no longer excessive here
It repeats.
Based on this, in this specification embodiment, multiplication processing is carried out according to the target image content, generates multiple changes
Image is changed, specifically may include:Geometric projection processing is carried out for the target image content, multiple geometric projections is generated and becomes
Change picture.
Further, Geometric projection processing is carried out for the target image content, specifically may include:For described
Target image content is singly answered projective transformation or affine projection to convert.
2, display effect converts
Other than above-mentioned shooting angle, under the conditions ofs different optical focusings, illumination etc., the same logo is captured to be obtained
To the display effect of picture also have larger difference.For this reason, it may be necessary to common display effect is simulated, such as:Under empty burnt, low illumination
Take pictures caused noise, light it is too strong caused by tone variation caused by overexposure, photobehavior difference etc..
So, in the present embodiment, the display effect that different methods may be used for logo is converted.Wherein,
Empty coke effect simply can carry out smothing filtering to image and obtain.Low illumination noise then can be by adding salt-pepper noise come mould
It is quasi-.Tone variations can be by color spaces such as the HIS/YUV/Lab that converts image from RGB color, to color component
Reconvert is returned rgb space and is obtained after modifying.For example, as shown in fig. 6, being shown for a certain logo (the first from left in Fig. 6)
The burnt figure (the second from left in Fig. 6) of void, noise pattern (right side two in Fig. 6) and the tone reversal figure respectively obtained after effect transformation is (right in Fig. 6
One).
Based on this, in this specification embodiment, multiplication processing is carried out according to the target image content, generates multiple changes
Image is changed, specifically may include:Display effect conversion process is carried out for the target image content, generates multiple display effects not
Same changing image.
Further, display effect conversion process is carried out for the target image content, generates multiple display effects not
Same changing image, specifically may include:
The disposal of gentle filter is carried out for the target image content, generates the changing image with empty burnt display effect;
Salt-pepper noise is added for the target image content, generates the changing image with noise display effect;
Color space conversion processing is carried out for the target image content, generates the Transformation Graphs with tone reversal effect
Picture.
3, background is replaced
In view of in practical applications, user may be scanned under different occasions for target image content/
Shooting, and scanning/shooting of user is typically more random, then, often there is different backgrounds in the image collected.Figure
Background as in has the larger identification that may be influenced to target image content.Therefore in this specification embodiment, in order to follow-up
Image recognition model can identify corresponding target image content in the image with different background, therefore can be by standard
Target image content and the great amount of images background obtained combine, and generate background and replace image, are used for the training of model.
As a kind of feasible pattern in this specification embodiment, different background pictures can be obtained in advance and forms phase
The Background valut answered.The Background valut can be stored in server shown in Fig. 1 or as self contained data base with
The server is associated with, in order to which server trains corresponding image recognition model.Wherein, background picture can with personage, object,
Natural scene, building etc. are used as background, here and without specifically limiting.
Certainly, during carrying out background replacement, the color inside certain logo immobilizes, and inside certain logo
It is hollow out, therefore different mapping modes can be set (such as this:Background replacement side is automatically selected by the channels Alpha
Formula).
Four, model training
When practical application, for the logo of texture complexity, using put matched mode carry out match cognization can obtain compared with
Good effect;And for the simple logo of texture, traditional point matching way causes to identify very little due to the characteristic point that can be extracted
Rate is relatively low.Therefore, it is trained using the identification model of deep learning in this specification embodiment.
As specifically the identification model of target detection usually can be used for letter in foregoing teachings in this specification embodiment
Easy logo is identified.Simultaneously in view of the image recognition model that training is completed can be applied in the client, it is possible to select
The fast SSD (Single Shot Multibox Detector) of accuracy of detection height, detection speed is selected as image recognition model
Algorithm frame.
More specifically, occupied space smaller MobileNet when can select relatively small neural network structure, deployment
Basic network model of the network as SSD.
Certainly, the restriction to the application should not be constituted here, can also be selected as needed in practical application different
Neural network model.
Five, picture is misidentified
Despite the use of above-mentioned multiplication processing, image recognition model still are possible to misidentify in practical applications.
So, in this specification embodiment, the picture of misrecognition can be used, participates in the iteration instruction to image recognition model again
Practice.
Specifically, for the picture of misrecognition, following processing mode may be used.
1, picture will be misidentified as background picture, be added in Background valut.So, when carrying out multiplication processing,
The background that misrecognition picture can participate in logo is replaced.
2, the logo of misrecognition is placed directly against on misrecognition picture, forms new a logo pictures and other logo
Picture carries out multiplication processing together.
3, flase drop pictures are established, specifically, training when, by flase drop pictures misrecognition picture and other
By multiplication treated training sample (that is, transformation picture) together as final training sample.
Six, online service is fed back
It is fed back using online service, can determine misrecognition picture, these misrecognition pictures can be added to above-mentioned mistake
It examines in pictures, to be iterated update to image recognition model.In addition, being fed back by online service, one can also be obtained
The logo pictures of a little missing inspections, are added in training set after these pictures are labeled and participate in training, again to promote discrimination.
Further, it is also possible to any all prodigious Background of a difference added in some and existing background picture is concentrated to Background,
Abundant background picture collection generates flase drop after preventing after the new logo pictures of addition.
In conjunction with foregoing teachings, as a kind of relatively conventional application scenarios, user uses corresponding client, can start this
Image scanning/shooting function in, foregoing AR scanning functions, is scanned sweep object, and client can be with
On the basis of above-mentioned image recognition model, sweep object (logo) is identified, and can be shown on sweep object different
AR contents.
Certainly, other than identifying simple logo, it is contemplated that the present invention may be use with the other simple graphs of identification.
It is the image-recognizing method that this specification embodiment provides above, is based on same thinking, in test end side, this theory
Bright book embodiment also provides a kind of pattern recognition device, as shown in Figure 7.Described device includes:
Acquisition module 701 obtains original image;Wherein, include target image content in the original image;
Image processing module 702 carries out multiplication processing according to the target image content, generates multiple changing images;
Training module 703 carries out model training using the changing image as training sample, obtains image recognition model,
To be identified for the images to be recognized comprising target image content.
Further, the acquisition module 701 obtains the original image, and receives to be directed in the original image and wrap
The labeling operation of the target image content contained generates the markup information corresponding to the target image content.
Described image processing module 702 carries out Geometric projection processing for the target image content, generates multiple
Geometric projection picture.
Described image processing module 702 is singly answered projective transformation or affine projection to become for the target image content
It changes.
Described image processing module 702 carries out display effect conversion process for the target image content, generates multiple
The different changing image of display effect.
Described image processing module 702 carries out the disposal of gentle filter for the target image content, generates with empty burnt
The changing image of display effect;
Salt-pepper noise is added for the target image content, generates the changing image with noise display effect;
Color space conversion processing is carried out for the target image content, generates the Transformation Graphs with tone reversal effect
Picture.
Described image processing module 702 is generated based on the Background valut and the target image content pre-established
Background replaces image.
Described device further includes:Flase drop module 704 receives the image error messages of user feedback, according to described image report
Wrong message determines misrecognition image, training is iterated according to the misrecognition image.
The flase drop module 704 carries out again using the misrecognition image as background picture with the target image content
Increasing is handled, and generates transformation picture, or, according to the target image content of misrecognition and misrecognition image, generates original image, with
It is iterated training, or, misrecognition image collection is established, and using the misrecognition image in the misrecognition image collection as waiting instructing
Practice sample and is iterated training.
The target image content includes:Simple logo, figure or pattern.
Based on device shown in Fig. 7, in practical applications can by entity equipment (such as:Server and/or terminal) institute is in fact
It is existing, specifically, the equipment includes:Processor, memory, wherein
The memory stores image recognition program;
The processor calls the image recognition program stored in memory, and executes:
Obtain original image;Wherein, include target image content in the original image;
Multiplication processing is carried out according to the target image content, generates multiple changing images;
Model training is carried out using the changing image as training sample, image recognition model is obtained, to be directed to comprising mesh
The images to be recognized of logo image content is identified.
Each embodiment in this specification is described in a progressive manner, identical similar portion between each embodiment
Point just to refer each other, and each embodiment focuses on the differences from other embodiments.Especially for device,
For equipment and medium class embodiment, since it is substantially similar to the method embodiment, so description is fairly simple, related place
Illustrate referring to the part of embodiment of the method, just no longer repeats one by one here.
So far, the specific embodiment of this theme is described.Other embodiments are in the appended claims
In range.In some cases, the action recorded in detail in the claims can execute and still in a different order
Desired result may be implemented.In addition, the process described in the accompanying drawings not necessarily requires the particular order shown or continuous suitable
Sequence, to realize desired result.In some embodiments, multitasking and parallel processing can be advantageous.
In the 1990s, the improvement of a technology can be distinguished clearly be on hardware improvement (for example,
Improvement to circuit structures such as diode, transistor, switches) or software on improvement (improvement for method flow).So
And with the development of technology, the improvement of current many method flows can be considered as directly improving for hardware circuit.
Designer nearly all obtains corresponding hardware circuit by the way that improved method flow to be programmed into hardware circuit.Cause
This, it cannot be said that the improvement of a method flow cannot be realized with hardware entities module.For example, programmable logic device
(Programmable Logic Device, PLD) (such as field programmable gate array (Field Programmable Gate
Array, FPGA)) it is exactly such a integrated circuit, logic function determines device programming by user.By designer
Voluntarily programming comes a digital display circuit " integrated " on a piece of PLD, designs and makes without asking chip maker
Dedicated IC chip.Moreover, nowadays, substitution manually makes IC chip, this programming is also used instead mostly " patrols
Volume compiler (logic compiler) " software realizes that software compiler used is similar when it writes with program development,
And the source code before compiling also write by handy specific programming language, this is referred to as hardware description language
(Hardware Description Language, HDL), and HDL is also not only a kind of, but there are many kind, such as ABEL
(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description
Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL
(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby
Hardware Description Language) etc., VHDL (Very-High-Speed are most generally used at present
Integrated Circuit Hardware Description Language) and Verilog.Those skilled in the art also answer
This understands, it is only necessary to method flow slightly programming in logic and is programmed into integrated circuit with above-mentioned several hardware description languages,
The hardware circuit for realizing the logical method flow can be readily available.
Controller can be implemented in any suitable manner, for example, controller can take such as microprocessor or processing
The computer for the computer readable program code (such as software or firmware) that device and storage can be executed by (micro-) processor can
Read medium, logic gate, switch, application-specific integrated circuit (Application Specific Integrated Circuit,
ASIC), the form of programmable logic controller (PLC) and embedded microcontroller, the example of controller includes but not limited to following microcontroller
Device:ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, are deposited
Memory controller is also implemented as a part for the control logic of memory.It is also known in the art that in addition to
Pure computer readable program code mode is realized other than controller, can be made completely by the way that method and step is carried out programming in logic
Controller is obtained in the form of logic gate, switch, application-specific integrated circuit, programmable logic controller (PLC) and embedded microcontroller etc. to come in fact
Existing identical function.Therefore this controller is considered a kind of hardware component, and to including for realizing various in it
The device of function can also be considered as the structure in hardware component.Or even, it can will be regarded for realizing the device of various functions
For either the software module of implementation method can be the structure in hardware component again.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.It is a kind of typically to realize that equipment is computer.Specifically, computer for example may be used
Think personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
It is any in device, navigation equipment, electronic mail equipment, game console, tablet computer, wearable device or these equipment
The combination of equipment.
For convenience of description, it is divided into various units when description apparatus above with function to describe respectively.Certainly, implementing this
The function of each unit is realized can in the same or multiple software and or hardware when application.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.Moreover, the present invention can be used in one or more wherein include computer usable program code computer
The computer program production implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
Instruct the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real
The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or
The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology realizes information storage.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storages, magnetic tape cassette, tape magnetic disk storage or other magnetic storage apparatus
Or any other non-transmission medium, it can be used for storage and can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
Including so that process, method, commodity or equipment including a series of elements include not only those elements, but also wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that wanted including described
There is also other identical elements in the process of element, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application
Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code
The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The application can describe in the general context of computer-executable instructions executed by a computer, such as program
Module.Usually, program module includes routines performing specific tasks or implementing specific abstract data types, program, object, group
Part, data structure etc..The application can also be put into practice in a distributed computing environment, in these distributed computing environments, by
Task is executed by the connected remote processing devices of communication network.In a distributed computing environment, program module can be with
In the local and remote computer storage media including storage device.
Each embodiment in this specification is described in a progressive manner, identical similar portion between each embodiment
Point just to refer each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality
For applying example, since it is substantially similar to the method embodiment, so description is fairly simple, related place is referring to embodiment of the method
Part explanation.
Above is only an example of the present application, it is not intended to limit this application.For those skilled in the art
For, the application can have various modifications and variations.It is all within spirit herein and principle made by any modification, equivalent
Replace, improve etc., it should be included within the scope of claims hereof.