CN106686308B - Image focal length detection method and device - Google Patents

Image focal length detection method and device Download PDF

Info

Publication number
CN106686308B
CN106686308B CN201611240404.3A CN201611240404A CN106686308B CN 106686308 B CN106686308 B CN 106686308B CN 201611240404 A CN201611240404 A CN 201611240404A CN 106686308 B CN106686308 B CN 106686308B
Authority
CN
China
Prior art keywords
picture
target
detected
image
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611240404.3A
Other languages
Chinese (zh)
Other versions
CN106686308A (en
Inventor
王健宗
肖京
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201611240404.3A priority Critical patent/CN106686308B/en
Priority to PCT/CN2017/078002 priority patent/WO2018120460A1/en
Publication of CN106686308A publication Critical patent/CN106686308A/en
Priority to TW106132589A priority patent/TWI658730B/en
Application granted granted Critical
Publication of CN106686308B publication Critical patent/CN106686308B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Analysis (AREA)
  • Studio Devices (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a kind of image focal length detection method, methods described includes:The picture to be detected shot is obtained, the target area in the picture to be detected where target image is determined by preset image detection model;Calculate target area area ratio shared in the picture to be detected;Whether photographing request is met according to the focal length that the area ratio determines to shoot the picture to be detected.The invention also discloses a kind of image focal length detection means.The present invention realizes the undesirable picture of automatic screening shooting process mid-focal length, reduces the difficulty of the screening undesirable picture of shooting process mid-focal length.

Description

Image focal length detection method and device
Technical field
The present invention relates to image technique field, more particularly to a kind of image focal length detection method and device.
Background technology
In the business scenario that some require picture detail higher, the shooting distance of picture directly affects making for picture With value.Detailed information of the picture of shooting distance too far due to needs can not be provided, not only waste memory space but also meeting Consume valuable computing resource.Therefore, carry out screening out the picture of shooting distance farther out before storage and processing business picture Just seem necessary, but compare consumption manpower and material resources using the picture of artificial screening shooting distance farther out, and with figure The expansion of sheet data scale, the difficulty of screening can be increasing.
The content of the invention
It is a primary object of the present invention to provide a kind of image focal length detection method and device, it is intended to solve existing screening The big technical problem of the undesirable picture difficulty of shooting process mid-focal length.
To achieve the above object, a kind of image focal length detection method provided by the invention, described image focal distance detecting method Including:
The picture to be detected shot is obtained, target in the picture to be detected is determined by preset image detection model Target area where image;
Calculate target area area ratio shared in the picture to be detected;
Whether photographing request is met according to the focal length that the area ratio determines to shoot the picture to be detected.
Preferably, it is described to obtain the picture to be detected shot, determined by preset image detection model described to be checked Include in mapping piece the step of target area where target image:
The picture to be detected shot is obtained, the picture to be detected is loaded into the region of described image detection model Generate in network, to determine candidate region of the target image in the picture to be detected, wherein, the Area generation net Network is convolutional neural networks;
The candidate region is loaded into the target detection network of described image detection model, to determine the candidate region In the target image where target area.
Preferably, it is described to be loaded into the candidate region in the target detection network of described image detection model, to determine Before the step of target area where the target image in the candidate region, in addition to:
Obtain reference zone corresponding with the target image in described image detection model;
The error of target image position described in the candidate region and the reference zone is calculated, according to the mistake Difference, pass through Area generation network described in network optimization function optimization.
Preferably, it is described to determine whether the focal length for shooting the picture to be detected meets shooting and want according to the area ratio The step of asking includes:
Judge whether the area ratio is less than predetermined threshold value;
If the area ratio is less than the predetermined threshold value, it is determined that the focal length of the shooting picture to be detected, which is not inconsistent, is in step with Take the photograph requirement;
If the area ratio is more than or equal to the predetermined threshold value, it is determined that the focal length of the shooting picture to be detected Meet photographing request.
Preferably, it is described to obtain the picture to be detected shot, determined by preset image detection model described to be checked In mapping piece the step of target area where target image before, in addition to:
Obtain preset data corresponding with the target image that described image detection model can be detected;
The Area generation network of described image detection model, the area after being adjusted are adjusted according to the preset data Domain generates network;
Target area training data is generated by the Area generation network after adjustment;
Optimize the target detection network of described image detection model according to the target area training data;
The Area generation network and the feature extraction layer of the target detection network share are determined, the fixed feature carries Take layer.
In addition, to achieve the above object, the present invention also provides a kind of image focal length detection means, the detection of described image focal length Device includes:
First determining module, for obtaining the picture to be detected shot, institute is determined by preset image detection model State the target area where target image in picture to be detected;
Computing module, the area ratio shared in the picture to be detected for calculating the target area;
Whether the second determining module, the focal length for determining to shoot the picture to be detected according to the area ratio meet Photographing request.
Preferably, first determining module is additionally operable to obtain the picture to be detected shot, will be described to be detected Picture is loaded into the Area generation network of described image detection model, to determine the target image in the picture to be detected Candidate region, wherein, the Area generation network is convolutional neural networks;The candidate region is loaded into described image detection In the target detection network of model, to determine the target area where the target image in the candidate region.
Preferably, described image focal length detection means also includes:
Acquiring unit, for obtaining reference zone corresponding with the target image in described image detection model;
Optimize unit, for calculating the mistake of target image position described in the candidate region and the reference zone Difference, according to the error, pass through Area generation network described in network optimization function optimization.
Preferably, second determining module includes:
Judging unit, for judging whether the area ratio is less than predetermined threshold value;
Determining unit, if being less than the predetermined threshold value for the area ratio, it is determined that the shooting picture to be detected Focal length do not meet photographing request;If the area ratio is more than or equal to the predetermined threshold value, it is determined that is treated described in shooting The focal length of detection picture meets photographing request.
Preferably, described image focal length detection means also includes:
Acquisition module, for obtaining preset data corresponding with the target image that described image detection model can be detected;
Adjusting module, for adjusting the Area generation network of described image detection model according to the preset data, obtain The Area generation network after adjustment;
Generation module, for generating target area training data by the Area generation network after adjustment;
Optimization module, for optimizing the target detection net of described image detection model according to the target area training data Network;
3rd determining module, for determining the feature extraction of the Area generation network and the target detection network share Layer, the fixed feature extraction layer.
The present invention determines the mesh where target image in acquired picture to be detected by preset image detection model Region is marked, target area area ratio shared in the picture to be detected is calculated, is determined according to the area ratio Whether the focal length for shooting the picture to be detected meets photographing request.Realize automatic screening shooting process mid-focal length do not meet will The picture asked, reduce the difficulty of the screening undesirable picture of shooting process mid-focal length.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the preferred embodiment of image focal length detection method of the present invention;
Fig. 2 is to obtain the picture to be detected shot in the embodiment of the present invention, is determined by preset image detection model A kind of schematic flow sheet of target area in the picture to be detected where target image;
Fig. 3 is the high-level schematic functional block diagram of the preferred embodiment of image focal length detection means of the present invention.
The realization, functional characteristics and advantage of the object of the invention will be described further referring to the drawings in conjunction with the embodiments.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of image focal length detection method.
Reference picture 1, Fig. 1 are the schematic flow sheet of image focal length detection method preferred embodiment of the present invention.
In the present embodiment, described image focal distance detecting method includes:
Step S10, the picture to be detected shot is obtained, the mapping to be checked is determined by preset image detection model Target area in piece where target image.
When getting the picture to be detected that has shot, it is thus necessary to determine that whether the focal length of the shooting picture to be detected meets to use When family requires, acquisition pre-sets image detection model corresponding with the picture to be detected, true by the detection model Target area in the fixed picture to be detected where target image.It should be noted that the target image is described to be checked Primary articles to display in mapping piece, be a car the picture to be detected as described in is to display, then it is described to be detected Car in picture is exactly the target image.Described image detection model is pre-set, and described image detection model can A target image is detected, multiple target images can also be detected.As described image detection model may be configured as a detection car Image, or be arranged to detect car and the image of people etc..
Further, during described image detection model is set, first collect described image detection model to be detected Target image corresponding to picture set, wherein, the pictures of multiple same target images is contained in the picture set, such as There are 10 pictures containing automobile.Target image in the picture set is labeled, obtains the mark of the picture set Information is noted, the markup information of every pictures is stored in same file folder in the form of a list.In the file, often One records the label information that correspond to a pictures.It should be noted that the first row of the file is the pictures Per the complete store path of pictures in conjunction;Second is classified as the number of target image in every pictures, may in a such as pictures There are a car or more cars;Row behind secondary series represent the area that target image marks in every pictures in the picture set Domain, i.e., coordinate of the described target image in the picture, coordinate topLeft_x and topLeft_y as used the upper left corner, and Bottom right angular coordinate bottomRight_x and bottomRight_y are represented.If the it is understood that target figure in certain pictures The number of picture is more than 1, then the pictures correspond to multiple top left co-ordinates and multiple bottom right angular coordinates.If the file The number of middle secondary series is more than or equal to 1, then can at least there are 4 column numbers after the secondary series of the list, and it is described The number of row behind secondary series must be 4 multiple.
Described image detection model includes two parts, and Part I is Area generation network, described to be detected for generating Candidate region in picture where target image, the candidate region are that the target image can in the picture to be detected Rectangular area existing for energy;Part II is target detection network, for determining the target image in the candidate region The target area at place.It should be noted that the Area generation network is the full convolutional neural networks of depth.The convolution Neutral net is a kind of feedforward neural network, and its artificial neuron can respond the surrounding cells in a part of coverage, There is outstanding performance for large-scale image procossing.The basic structure of the convolutional neural networks includes two layers, and one is characterized extraction Layer, the input of each neuron is connected with the local acceptance region of preceding layer, and extracts the local feature, once the local feature After being extracted, its position relationship between further feature is also decided therewith;The second is Feature Mapping layer, each meter of network Calculate layer to be made up of multiple Feature Mappings, each Feature Mapping is a plane, and the weights of all neurons are equal in plane.
Further, described image focal distance detecting method also includes:
Step a, obtain preset data corresponding with the target image that described image detection model can be detected;
Step b, the Area generation network of described image detection model is adjusted according to the preset data, after being adjusted The Area generation network;
Before using described image detection model, the Area generation network in described image detection model is first trained, Optimize described image detection model.Area generation network in described image detection model is trained first, detailed process For:Picture corresponding with the target image that described image detection model is detected is inputted in the Area generation network, that is, is obtained Take preset data corresponding with the target image that described image detection model can be detected.It is understood that preset data is Picture corresponding with the target image.After picture corresponding with the target image is obtained, according to the target image Corresponding picture tests the Area generation network, obtains test result, and the Area generation is adjusted according to the test result Network, the Area generation network after being adjusted.In the present embodiment, the Area generation network is trained in order to reduce Time, can be first to the Area generation netinit.
Step c, target area training data is generated by the Area generation network after adjustment;
Step d, optimize the target detection network of described image detection model according to the target area training data;
Step e, determines the Area generation network and the feature extraction layer of the target detection network share, it is fixed described in Feature extraction layer.
After Area generation network after being adjusted, existed by inputting the picture in the Area generation network Target area training data is generated in the Area generation network after adjustment, institute is tested according to the target area training data The target detection network of image detection model is stated, obtains test result, the target detection net is optimized according to the test structure Network.After the target detection network is optimized, the feature extraction layer of the target detection network after optimization is obtained, passes through institute The feature extraction layer for stating target detection network initializes the feature extraction layer of the Area generation network, the fixed Area generation The feature extraction layer of network.When securing the above the feature extraction layer of Area generation network, by the Area generation network Feature extraction layer is copied in the target detection network, is total to the fixation target detection network and the Area generation network The feature extraction layer enjoyed.It is understood that the Area generation network and the target detection network sharing features extract layer, I.e. shared multilayer convolutional layer.In the Area generation network and the target detection network development process is trained, the region is given birth to Into network and the target detection network alternative optimization.
Step S20, calculate target area area ratio shared in the picture to be detected.
When it is determined that behind target area where target image in the picture to be detected, calculating the face of the target area The area of product and the picture to be detected, by the area of the target area divided by the area of the picture to be detected, obtains institute State target area area ratio shared in the picture to be detected.
Step S30, whether photographing request is met according to the focal length that the area ratio determines to shoot the picture to be detected.
When it is determined that after the area ratio shared in the picture to be detected of the target area, according to the area ratio It is determined that whether the focal length of the shooting picture to be detected meets photographing request.
Further, step S30 includes:
Step f, judges whether the area ratio is less than predetermined threshold value;
Step g, if the area ratio is less than the predetermined threshold value, it is determined that the focal length of the shooting picture to be detected is not Meet photographing request;
Step h, if the area ratio is more than or equal to the predetermined threshold value, it is determined that the shooting picture to be detected Focal length meet photographing request.
Determine whether the focal length for shooting the picture to be detected meets the specific mistake of photographing request according to the area ratio Cheng Wei:Judge whether the area ratio is less than predetermined threshold value, wherein, the predetermined threshold value is set for the specific needs of basis, It such as may be configured as 0.05,0.08, or 0.10 etc..When the area ratio is less than the predetermined threshold value, it is determined that described in shooting The focal length of picture to be detected does not meet shooting and asked;When the area ratio is more than or equal to the predetermined threshold value, it is determined that clapping The focal length for taking the photograph the picture to be detected meets photographing request.Further, when it is determined that shooting the focal length of the picture to be detected not When meeting shooting and asking, prompt message is exported, prompts the hypertelorism that user shoots the picture to be detected, it is necessary to re-shoot institute State picture to be detected;When it is determined that the focal length of the shooting picture to be detected meets photographing request, prompt message is exported, prompts to use The picture to be detected captured by family meets photographing request, and stores the picture to be detected.
The present embodiment is determined in acquired picture to be detected by preset image detection model where target image Target area, target area area ratio shared in the picture to be detected is calculated, it is true according to the area ratio Whether the focal length for shooting the picture to be detected surely meets photographing request.Automatic screening shooting process mid-focal length is realized not meet It is required that picture, reduce screening the undesirable picture of shooting process mid-focal length difficulty.
Further, the preferred embodiment based on image focal length detection method of the present invention proposes another implementation of the present invention Example, reference picture 2, in the present embodiment, the step S10 include:
Step S11, the picture to be detected shot is obtained, the picture to be detected is loaded into described image detection mould In the Area generation network of type, to determine candidate region of the target image in the picture to be detected, wherein, the area Domain generation network is convolutional neural networks;
Step S12, the candidate region is loaded into the target detection network of described image detection model, with described in determination The target area where the target image in candidate region.
When getting the picture to be detected shot, the picture to be detected is loaded into described image detection model Area generation network in, the candidate region in the picture to be detected is determined by the Area generation network.By the time Favored area is loaded into the target detection network of described image detection model, to determine the target image in the candidate region The target area at place.In the present embodiment, the candidate region in the picture to be detected has one or more, and each time The target image is there may be in favored area.Further, the candidate region is shaped as rectangle, the Area generation net Network is convolutional neural networks.In order to improve the speed of the target area where the determination target image, the Area generation net Network and the target detection network sharing features extract layer,
The detailed process for determining the target area where the target image is:In last of the Area generation network The small convolutional network that one input dimension is nxn is set in the Feature Mapping exported in individual convolutional layer.It is it should be noted that described The dimension nxn of convolutional network is less than the dimension N x N of last convolutional layer of the Area generation network, and (n and N is just Integer), will the Area generation network the area maps that are covered of last convolutional layer to a more low dimensional spy Levy on mapping layer.The Feature Mapping layer the be fully connected layer parallel with two connects.In the present embodiment, the two connect completely Connect layer and be referred to as cls layers and reg layers.The cls layers are used to determine the possibility containing target image in the candidate region, Contain the probability containing target image in the candidate region, the reg layers are used to determine mesh described in the candidate region Position where logo image, to determine the size of the target image and displacement.Such as when the small convolutional network dimension set is During 3x3, the Area generation network is the convolution kernel that a yardstick is 3x3, exports the convolutional network layer for 256, the convolution Two complete convolutional layer cls layers and reg layers are connected behind Internet.The convolution kernel of the 3x3 can be with 3 kinds of contractings on each position Put and amount to candidate region described in 9 kinds of schema creations with 3 kinds of wide height modes, to determine the candidate being loaded into the target detection network The size of target image and displacement have robustness in region.
Further, before the step S12, in addition to:
Step i, obtain reference zone corresponding with the target image in described image detection model;
Step j, the error of target image position described in the candidate region and the reference zone is calculated, according to The error, pass through Area generation network described in network optimization function optimization.
It is determined that behind the candidate region, reference area corresponding with the target image in described image detection model is obtained Domain, the reference zone are determined by the markup information stored in described image detection model.Determine mesh in the candidate region The top left co-ordinate and bottom right angular coordinate of position where logo image, and determine that target image institute is in place in the reference zone The top left co-ordinate and bottom right angular coordinate put.According to the top left co-ordinate of the position where target image in the candidate region and Bottom right angular coordinate determines scope of the target image in the candidate region, is designated as the first scope;According to the reference area The top left co-ordinate of target image position and bottom right angular coordinate determine the target image in the reference zone in domain Scope, be designated as the second scope.The common factor between first scope and second scope is calculated, and calculates described first Union between scope and second scope, by the common factor divided by the union, obtain the candidate region and the ginseng Error described in the domain of examination district between target image position.The error and default error are contrasted, described in judgement Whether error is more than default error.When the error is more than or equal to the default error, represent that the candidate region contains There is the target image;When the error is less than the default error, represent that the candidate region does not contain the target figure Picture.Wherein, the default error can be set according to specific needs, and in the present embodiment, the default error is arranged to 0.7.
After the error is obtained, according to the error, pass through Area generation network described in network optimization function optimization, tool Body is the neuron in the optimization Area generation network.The network optimization function L is:
Wherein, i is the index for the set of candidate regions that multiple candidate regions are formed, piIt is to be deposited in i-th of candidate region In the probability of target image.Represent whether the candidate region contains the target image, value is 0 or 1, when value is When 1, represent that the target image is contained in the candidate region, when value is 0, represent that the candidate region does not contain the mesh Logo image, determined by the error.tiIt is the target image of the Area generation neural network forecast in the candidate region Coordinate, be 4 dimensional vectors in form.DclsIt is the quantity of target image in the input candidate region, in the present embodiment In, Dcls=256, DregIt is the number that the new candidate region obtained after 3 kinds of scalings and 3 kinds of aspect ratio transformations is done in the candidate region Amount, in the present embodiment, Dreg=256*9.λ is arranged to 10, and the candidate region and the target area are determined with balance Significance level.It is understood that in other embodiments, the Dcls、DregIt can be arranged as required to as other values with λ.
The present embodiment is by the way that the picture to be detected to be loaded into the Area generation network and target of described image detection model Detect in network, obtain the target area where target image in the network to be detected, so as to real according to the target area Whether the focal length that existing automatic decision shoots the picture to be detected meets photographing request.
The present invention further provides a kind of image focal length detection means 100.
Reference picture 3, Fig. 3 are the high-level schematic functional block diagram of the preferred embodiment of image focal length detection means 100 of the present invention.
It is emphasized that it will be apparent to those skilled in the art that module map shown in Fig. 3 is only a preferred embodiment Exemplary plot, the module of image focal length detection means 100 of the those skilled in the art shown in Fig. 3, can carry out easily new Module supplement;The title of each module is self-defined title, is only used for auxiliary and understands each of the image focal length detection means 100 Individual program function block, restriction technical scheme is not used in, the core of technical solution of the present invention is, each self-defined title The function to be reached of module.
In the present embodiment, described image focal length detection means 100 includes:
First determining module 10, for obtaining the picture to be detected shot, determined by preset image detection model Target area in the picture to be detected where target image.
When getting the picture to be detected that has shot, it is thus necessary to determine that whether the focal length of the shooting picture to be detected meets to use When family requires, acquisition pre-sets image detection model corresponding with the picture to be detected, true by the detection model Target area in the fixed picture to be detected where target image.It should be noted that the target image is described to be checked Primary articles to display in mapping piece, be a car the picture to be detected as described in is to display, then it is described to be detected Car in picture is exactly the target image.Described image detection model is pre-set, and described image detection model can A target image is detected, multiple target images can also be detected.As described image detection model may be configured as a detection car Image, or be arranged to detect car and the image of people etc..
Further, during described image detection model is set, first collect described image detection model to be detected Target image corresponding to picture set, wherein, the pictures of multiple same target images is contained in the picture set, such as There are 10 pictures containing automobile.Target image in the picture set is labeled, obtains the mark of the picture set Information is noted, the markup information of every pictures is stored in same file folder in the form of a list.In the file, often One records the label information that correspond to a pictures.It should be noted that the first row of the file is the pictures Per the complete store path of pictures in conjunction;Second is classified as the number of target image in every pictures, may in a such as pictures There are a car or more cars;Row behind secondary series represent the area that target image marks in every pictures in the picture set Domain, i.e., coordinate of the described target image in the picture, coordinate topLeft_x and topLeft_y as used the upper left corner, and Bottom right angular coordinate bottomRight_x and bottomRight_y are represented.If the it is understood that target figure in certain pictures The number of picture is more than 1, then the pictures correspond to multiple top left co-ordinates and multiple bottom right angular coordinates.If the file The number of middle secondary series is more than or equal to 1, then can at least there are 4 column numbers after the secondary series of the list, and it is described The number of row behind secondary series must be 4 multiple.
Described image detection model includes two parts, and Part I is Area generation network, described to be detected for generating Candidate region in picture where target image, the candidate region are that the target image can in the picture to be detected Rectangular area existing for energy;Part II is target detection network, for determining the target image in the candidate region The target area at place.It should be noted that the Area generation network is the full convolutional neural networks of depth.The convolution Neutral net is a kind of feedforward neural network, and its artificial neuron can respond the surrounding cells in a part of coverage, There is outstanding performance for large-scale image procossing.The basic structure of the convolutional neural networks includes two layers, and one is characterized extraction Layer, the input of each neuron is connected with the local acceptance region of preceding layer, and extracts the local feature, once the local feature After being extracted, its position relationship between further feature is also decided therewith;The second is Feature Mapping layer, each meter of network Calculate layer to be made up of multiple Feature Mappings, each Feature Mapping is a plane, and the weights of all neurons are equal in plane.
Further, described image focal length detection means 100 also includes:
Acquisition module, for obtaining preset data corresponding with the target image that described image detection model can be detected;
Adjusting module, for adjusting the Area generation network of described image detection model according to the preset data, obtain The Area generation network after adjustment;
Before using described image detection model, the Area generation network in described image detection model is first trained, Optimize described image detection model.Area generation network in described image detection model is trained first, detailed process For:Picture corresponding with the target image that described image detection model is detected is inputted in the Area generation network, that is, is obtained Take preset data corresponding with the target image that described image detection model can be detected.It is understood that preset data is Picture corresponding with the target image.After picture corresponding with the target image is obtained, according to the target image Corresponding picture tests the Area generation network, obtains test result, and the Area generation is adjusted according to the test result Network, the Area generation network after being adjusted.In the present embodiment, the Area generation network is trained in order to reduce Time, can be first to the Area generation netinit.
Generation module, for generating target area training data by the Area generation network after adjustment;
Optimization module, for optimizing the target detection net of described image detection model according to the target area training data Network;
3rd determining module, for determining the feature extraction of the Area generation network and the target detection network share Layer, the fixed feature extraction layer.
After Area generation network after being adjusted, existed by inputting the picture in the Area generation network Target area training data is generated in the Area generation network after adjustment, institute is tested according to the target area training data The target detection network of image detection model is stated, obtains test result, the target detection net is optimized according to the test structure Network.After the target detection network is optimized, the feature extraction layer of the target detection network after optimization is obtained, passes through institute The feature extraction layer for stating target detection network initializes the feature extraction layer of the Area generation network, the fixed Area generation The feature extraction layer of network.When securing the above the feature extraction layer of Area generation network, by the Area generation network Feature extraction layer is copied in the target detection network, is total to the fixation target detection network and the Area generation network The feature extraction layer enjoyed.It is understood that the Area generation network and the target detection network sharing features extract layer, I.e. shared multilayer convolutional layer.In the Area generation network and the target detection network development process is trained, the region is given birth to Into network and the target detection network alternative optimization.
Computing module 20, the area ratio shared in the picture to be detected for calculating the target area.
When it is determined that behind target area where target image in the picture to be detected, calculating the face of the target area The area of product and the picture to be detected, by the area of the target area divided by the area of the picture to be detected, obtains institute State target area area ratio shared in the picture to be detected.
Whether the second determining module 30, the focal length for determining to shoot the picture to be detected according to the area ratio accord with Close photographing request.
When it is determined that after the area ratio shared in the picture to be detected of the target area, according to the area ratio It is determined that whether the focal length of the shooting picture to be detected meets photographing request.
Further, second determining module 30 includes:
Judging unit, for judging whether the area ratio is less than predetermined threshold value;
Determining unit, if being less than the predetermined threshold value for the area ratio, it is determined that the shooting picture to be detected Focal length do not meet photographing request;If the area ratio is more than or equal to the predetermined threshold value, it is determined that is treated described in shooting The focal length of detection picture meets photographing request.
Determine whether the focal length for shooting the picture to be detected meets the specific mistake of photographing request according to the area ratio Cheng Wei:Judge whether the area ratio is less than predetermined threshold value, wherein, the predetermined threshold value is set for the specific needs of basis, It such as may be configured as 0.05,0.08, or 0.10 etc..When the area ratio is less than the predetermined threshold value, it is determined that described in shooting The focal length of picture to be detected does not meet shooting and asked;When the area ratio is more than or equal to the predetermined threshold value, it is determined that clapping The focal length for taking the photograph the picture to be detected meets photographing request.Further, when it is determined that shooting the focal length of the picture to be detected not When meeting shooting and asking, prompt message is exported, prompts the hypertelorism that user shoots the picture to be detected, it is necessary to re-shoot institute State picture to be detected;When it is determined that the focal length of the shooting picture to be detected meets photographing request, prompt message is exported, prompts to use The picture to be detected captured by family meets photographing request, and stores the picture to be detected.
The present embodiment is determined in acquired picture to be detected by preset image detection model where target image Target area, target area area ratio shared in the picture to be detected is calculated, it is true according to the area ratio Whether the focal length for shooting the picture to be detected surely meets photographing request.Automatic screening shooting process mid-focal length is realized not meet It is required that picture, reduce screening the undesirable picture of shooting process mid-focal length difficulty.
Further, the preferred embodiment based on image focal length detection means 100 of the present invention proposes another reality of the present invention Example is applied, in the present embodiment, first determining module 10 is additionally operable to obtain the picture to be detected shot, is treated described Detect picture to be loaded into the Area generation network of described image detection model, to determine the target image in the mapping to be checked Candidate region in piece, wherein, the Area generation network is convolutional neural networks;The candidate region is loaded into described image In the target detection network of detection model, to determine the target area where the target image in the candidate region.
When getting the picture to be detected shot, the picture to be detected is loaded into described image detection model Area generation network in, the candidate region in the picture to be detected is determined by the Area generation network.By the time Favored area is loaded into the target detection network of described image detection model, to determine the target image in the candidate region The target area at place.In the present embodiment, the candidate region in the picture to be detected has one or more, and each time The target image is there may be in favored area.Further, the candidate region is shaped as rectangle, the Area generation net Network is convolutional neural networks.In order to improve the speed of the target area where the determination target image, the Area generation net Network and the target detection network sharing features extract layer,
The detailed process for determining the target area where the target image is:In last of the Area generation network The small convolutional network that one input dimension is nxn is set in the Feature Mapping exported in individual convolutional layer.It is it should be noted that described The dimension nxn of convolutional network is less than the dimension N x N of last convolutional layer of the Area generation network, and (n and N is just Integer), will the Area generation network the area maps that are covered of last convolutional layer to a more low dimensional spy Levy on mapping layer.The Feature Mapping layer the be fully connected layer parallel with two connects.In the present embodiment, the two connect completely Connect layer and be referred to as cls layers and reg layers.The cls layers are used to determine the possibility containing target image in the candidate region, Contain the probability containing target image in the candidate region, the reg layers are used to determine mesh described in the candidate region Position where logo image, to determine the size of the target image and displacement.Such as when the small convolutional network dimension set is During 3x3, the Area generation network is the convolution kernel that a yardstick is 3x3, exports the convolutional network layer for 256, the convolution Two complete convolutional layer cls layers and reg layers are connected behind Internet.The convolution kernel of the 3x3 can be with 3 kinds of contractings on each position Put and amount to candidate region described in 9 kinds of schema creations with 3 kinds of wide height modes, to determine the candidate being loaded into the target detection network The size of target image and displacement have robustness in region.
Further, described image focal length detection means also includes:
Acquiring unit, for obtaining reference zone corresponding with the target image in described image detection model;
Optimize unit, for calculating the mistake of target image position described in the candidate region and the reference zone Difference, according to the error, pass through Area generation network described in network optimization function optimization.
It is determined that behind the candidate region, reference area corresponding with the target image in described image detection model is obtained Domain, the reference zone are determined by the markup information stored in described image detection model.Determine mesh in the candidate region The top left co-ordinate and bottom right angular coordinate of position where logo image, and determine that target image institute is in place in the reference zone The top left co-ordinate and bottom right angular coordinate put.According to the top left co-ordinate of the position where target image in the candidate region and Bottom right angular coordinate determines scope of the target image in the candidate region, is designated as the first scope;According to the reference area The top left co-ordinate of target image position and bottom right angular coordinate determine the target image in the reference zone in domain Scope, be designated as the second scope.The common factor between first scope and second scope is calculated, and calculates described first Union between scope and second scope, by the common factor divided by the union, obtain the candidate region and the ginseng Error described in the domain of examination district between target image position.The error and default error are contrasted, described in judgement Whether error is more than default error.When the error is more than or equal to the default error, represent that the candidate region contains There is the target image;When the error is less than the default error, represent that the candidate region does not contain the target figure Picture.Wherein, the default error can be set according to specific needs, and in the present embodiment, the default error is arranged to 0.7.
After the error is obtained, according to the error, pass through Area generation network described in network optimization function optimization, tool Body is the neuron in the optimization Area generation network.The network optimization function L is:
Wherein, i is the index for the set of candidate regions that multiple candidate regions are formed, piIt is to be deposited in i-th of candidate region In the probability of target image.Represent whether the candidate region contains the target image, value is 0 or 1, when value is When 1, represent that the target image is contained in the candidate region, when value is 0, represent that the candidate region does not contain the mesh Logo image, determined by the error.tiIt is the target image of the Area generation neural network forecast in the candidate region Coordinate, be 4 dimensional vectors in form.DclsIt is the quantity of target image in the input candidate region, in the present embodiment In, Dcls=256, DregIt is the number that the new candidate region obtained after 3 kinds of scalings and 3 kinds of aspect ratio transformations is done in the candidate region Amount, in the present embodiment, Dreg=256*9.λ is arranged to 10, and the candidate region and the target area are determined with balance Significance level.It is understood that in other embodiments, the Dcls、DregIt can be arranged as required to as other values with λ.
The present embodiment is by the way that the picture to be detected to be loaded into the Area generation network and target of described image detection model Detect in network, obtain the target area where target image in the network to be detected, so as to real according to the target area Whether the focal length that existing automatic decision shoots the picture to be detected meets photographing request.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row His property includes, so that process, method, article or system including a series of elements not only include those key elements, and And also include the other key elements being not expressly set out, or also include for this process, method, article or system institute inherently Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this Other identical element also be present in the process of key element, method, article or system.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.Embodiment party more than The description of formula, it is required general that those skilled in the art can be understood that above-described embodiment method can add by software The mode of hardware platform is realized, naturally it is also possible to which by hardware, but the former is more preferably embodiment in many cases.It is based on Such understanding, the part that technical scheme substantially contributes to prior art in other words can be with software products Form embody, the meter
Calculation machine software product is stored in a storage medium (such as ROM/RAM, magnetic disc, CD), including some instructions are used To cause a station terminal equipment (can be mobile phone, computer, server, or network equipment etc.) to perform each implementation of the present invention Method described in example.
The preferred embodiments of the present invention are these are only, are not intended to limit the scope of the invention, it is every to utilize this hair The equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills Art field, is included within the scope of the present invention.

Claims (8)

1. a kind of image focal length detection method, it is characterised in that described image focal distance detecting method includes:
The picture to be detected shot is obtained, target image in the picture to be detected is determined by preset image detection model The target area at place;
Calculate target area area ratio shared in the picture to be detected;
Whether photographing request is met according to the focal length that the area ratio determines to shoot the picture to be detected;
It is described to obtain the picture to be detected shot, target in the picture to be detected is determined by preset image detection model The step of target area where image, includes:
The picture to be detected shot is obtained, the picture to be detected is loaded into the Area generation of described image detection model In network, to determine candidate region of the target image in the picture to be detected, wherein, the Area generation network is Convolutional neural networks;
The candidate region is loaded into the target detection network of described image detection model, to determine in the candidate region Target area where the target image.
2. image focal length detection method as claimed in claim 1, it is characterised in that described by described in the loading of the candidate region In the target detection network of image detection model, to determine the target area where the target image in the candidate region The step of before, in addition to:
Obtain reference zone corresponding with the target image in described image detection model;
The error of target image position described in the candidate region and the reference zone is calculated, according to the error, Pass through Area generation network described in network optimization function optimization.
3. image focal length detection method as claimed in claim 1, it is characterised in that described to determine to clap according to the area ratio Taking the photograph the step of whether the focal length of the picture to be detected meets photographing request includes:
Judge whether the area ratio is less than predetermined threshold value;
If the area ratio is less than the predetermined threshold value, it is determined that the focal length of the shooting picture to be detected does not meet shooting will Ask;
If the area ratio is more than or equal to the predetermined threshold value, it is determined that the focal length of the shooting picture to be detected meets Photographing request.
4. the image focal length detection method as described in any one of claims 1 to 3, it is characterised in that described to obtain what is shot Picture to be detected, the target area in the picture to be detected where target image is determined by preset image detection model Before step, in addition to:
Obtain preset data corresponding with the target image that described image detection model can be detected;
The Area generation network of described image detection model is adjusted according to the preset data, the region life after being adjusted Into network;
Target area training data is generated by the Area generation network after adjustment;
Optimize the target detection network of described image detection model according to the target area training data;
Determine the Area generation network and the feature extraction layer of the target detection network share, the fixed feature extraction Layer.
5. a kind of image focal length detection means, it is characterised in that described image focal length detection means includes:
First determining module, for obtaining the picture to be detected shot, by being treated described in preset image detection model determination Detect the target area where target image in picture;
Computing module, the area ratio shared in the picture to be detected for calculating the target area;
Whether the second determining module, the focal length for determining to shoot the picture to be detected according to the area ratio meet shooting It is required that;
First determining module is additionally operable to obtain the picture to be detected shot, by described in the picture loading to be detected In the Area generation network of image detection model, to determine candidate region of the target image in the picture to be detected, Wherein, the Area generation network is convolutional neural networks;The candidate region is loaded into the target of described image detection model Detect in network, to determine the target area where the target image in the candidate region.
6. image focal length detection means as claimed in claim 5, it is characterised in that described image focal length detection means is also wrapped Include:
Acquiring unit, for obtaining reference zone corresponding with the target image in described image detection model;
Optimize unit, for calculating the error of target image position described in the candidate region and the reference zone, According to the error, pass through Area generation network described in network optimization function optimization.
7. image focal length detection means as claimed in claim 5, it is characterised in that second determining module includes:
Judging unit, for judging whether the area ratio is less than predetermined threshold value;
Determining unit, if being less than the predetermined threshold value for the area ratio, it is determined that Jiao of the shooting picture to be detected Away from not meeting photographing request;If the area ratio is more than or equal to the predetermined threshold value, it is determined that shooting is described to be detected The focal length of picture meets photographing request.
8. the image focal length detection means as described in any one of claim 5 to 7, it is characterised in that described image focal length detects Device also includes:
Acquisition module, for obtaining preset data corresponding with the target image that described image detection model can be detected;
Adjusting module, for adjusting the Area generation network of described image detection model according to the preset data, it is adjusted The Area generation network afterwards;
Generation module, for generating target area training data by the Area generation network after adjustment;
Optimization module, for optimizing the target detection network of described image detection model according to the target area training data;
3rd determining module, for determining the feature extraction layer of the Area generation network and the target detection network share, The fixed feature extraction layer.
CN201611240404.3A 2016-12-28 2016-12-28 Image focal length detection method and device Active CN106686308B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201611240404.3A CN106686308B (en) 2016-12-28 2016-12-28 Image focal length detection method and device
PCT/CN2017/078002 WO2018120460A1 (en) 2016-12-28 2017-03-24 Image focal length detection method, apparatus and device, and computer-readable storage medium
TW106132589A TWI658730B (en) 2016-12-28 2017-09-22 Image focal length detection method and device thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611240404.3A CN106686308B (en) 2016-12-28 2016-12-28 Image focal length detection method and device

Publications (2)

Publication Number Publication Date
CN106686308A CN106686308A (en) 2017-05-17
CN106686308B true CN106686308B (en) 2018-02-16

Family

ID=58873212

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611240404.3A Active CN106686308B (en) 2016-12-28 2016-12-28 Image focal length detection method and device

Country Status (3)

Country Link
CN (1) CN106686308B (en)
TW (1) TWI658730B (en)
WO (1) WO2018120460A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11836903B2 (en) 2019-10-16 2023-12-05 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Subject recognition method, electronic device, and computer readable storage medium

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108848301A (en) * 2018-05-23 2018-11-20 阿里巴巴集团控股有限公司 A kind of bill shooting exchange method, device, processing equipment and client
CN110770739A (en) * 2018-10-31 2020-02-07 深圳市大疆创新科技有限公司 Control method, device and control equipment based on image recognition
CN110267041B (en) 2019-06-28 2021-11-09 Oppo广东移动通信有限公司 Image encoding method, image encoding device, electronic device, and computer-readable storage medium
CN110276767B (en) 2019-06-28 2021-08-31 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and computer readable storage medium
CN110248096B (en) 2019-06-28 2021-03-12 Oppo广东移动通信有限公司 Focusing method and device, electronic equipment and computer readable storage medium
CN110456829B (en) * 2019-08-07 2022-12-13 深圳市维海德技术股份有限公司 Positioning tracking method, device and computer readable storage medium
CN110660090B (en) 2019-09-29 2022-10-25 Oppo广东移动通信有限公司 Subject detection method and apparatus, electronic device, and computer-readable storage medium
CN110989344A (en) * 2019-11-27 2020-04-10 云南电网有限责任公司电力科学研究院 Automatic adjustment method and system for preset parameters of inspection robot
CN111626995B (en) * 2020-05-19 2024-03-01 上海艾豚科技有限公司 Intelligent insert detection method and device for workpiece
CN113242387B (en) * 2021-06-11 2022-05-03 广州立景创新科技有限公司 Camera module, focusing adjustment system and focusing method
TWI774418B (en) * 2021-06-11 2022-08-11 大陸商廣州立景創新科技有限公司 Camera module, focus adjustment system and focusing method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753846A (en) * 2008-12-05 2010-06-23 三星电子株式会社 Use camera to adjust the apparatus and method of character boundary automatically
CN103810696A (en) * 2012-11-15 2014-05-21 浙江大华技术股份有限公司 Method for detecting image of target object and device thereof
CN105654451A (en) * 2014-11-10 2016-06-08 中兴通讯股份有限公司 Image processing method and device
CN105894458A (en) * 2015-12-08 2016-08-24 乐视移动智能信息技术(北京)有限公司 Processing method and device of image with human face

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020947B (en) * 2011-09-23 2016-04-06 阿里巴巴集团控股有限公司 A kind of mass analysis method of image and device
US20150109513A1 (en) * 2012-04-26 2015-04-23 The Trustees of Collumbia University in the City York Systems, methods, and media for providing interactive refocusing in images
CN103024165B (en) * 2012-12-04 2015-01-28 华为终端有限公司 Method and device for automatically setting shooting mode
US9672416B2 (en) * 2014-04-29 2017-06-06 Microsoft Technology Licensing, Llc Facial expression tracking
CN105096350B (en) * 2014-05-21 2019-01-11 腾讯科技(深圳)有限公司 Image detecting method and device
CN105915791B (en) * 2016-05-03 2019-02-05 Oppo广东移动通信有限公司 Electronic apparatus control method and device, electronic device
CN106156749A (en) * 2016-07-25 2016-11-23 福建星网锐捷安防科技有限公司 Method for detecting human face based on selective search and device
CN106250931A (en) * 2016-08-03 2016-12-21 武汉大学 A kind of high-definition picture scene classification method based on random convolutional neural networks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101753846A (en) * 2008-12-05 2010-06-23 三星电子株式会社 Use camera to adjust the apparatus and method of character boundary automatically
CN103810696A (en) * 2012-11-15 2014-05-21 浙江大华技术股份有限公司 Method for detecting image of target object and device thereof
CN105654451A (en) * 2014-11-10 2016-06-08 中兴通讯股份有限公司 Image processing method and device
CN105894458A (en) * 2015-12-08 2016-08-24 乐视移动智能信息技术(北京)有限公司 Processing method and device of image with human face

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11836903B2 (en) 2019-10-16 2023-12-05 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Subject recognition method, electronic device, and computer readable storage medium

Also Published As

Publication number Publication date
TWI658730B (en) 2019-05-01
TW201841491A (en) 2018-11-16
CN106686308A (en) 2017-05-17
WO2018120460A1 (en) 2018-07-05

Similar Documents

Publication Publication Date Title
CN106686308B (en) Image focal length detection method and device
CN109685152B (en) Image target detection method based on DC-SPP-YOLO
CN104346370B (en) Picture search, the method and device for obtaining image text information
CN110490202A (en) Detection model training method, device, computer equipment and storage medium
CN107688823A (en) A kind of characteristics of image acquisition methods and device, electronic equipment
CN110490238A (en) A kind of image processing method, device and storage medium
CN107871011A (en) Image processing method, device, mobile terminal and computer-readable recording medium
CN104572804A (en) Video object retrieval system and method
CN112418351B (en) Zero sample learning image classification method based on global and local context sensing
CN104867225A (en) Banknote face orientation identification method and apparatus
CN107329962A (en) Image retrieval data library generating method, the method and device of augmented reality
CN107463906A (en) The method and device of Face datection
CN112598627A (en) Method, system, electronic device and medium for detecting image defects
CN111811525A (en) Road network generation method and system based on remote sensing image and floating car track
CN111144215B (en) Image processing method, device, electronic equipment and storage medium
CN112288758A (en) Infrared and visible light image registration method for power equipment
CN110189318A (en) Pulmonary nodule detection method and system with semantic feature score
JP4245872B2 (en) Similarity determination method, apparatus, and program
CN111027551B (en) Image processing method, apparatus and medium
CN113420833A (en) Visual question-answering method and device based on question semantic mapping
CN116416626B (en) Method, device, equipment and storage medium for acquiring circular seal data
TW202127312A (en) Image processing method and computer readable medium thereof
CN111414930B (en) Deep learning model training method and device, electronic equipment and storage medium
CN109886865A (en) Method, apparatus, computer equipment and the storage medium of automatic shield flame
CN110889635B (en) Method for performing emergency drilling on food safety event processing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1235944

Country of ref document: HK

REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1235944

Country of ref document: HK