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

Image focal length detection method and device Download PDF

Info

Publication number
CN106686308A
CN106686308A CN201611240404.3A CN201611240404A CN106686308A CN 106686308 A CN106686308 A CN 106686308A CN 201611240404 A CN201611240404 A CN 201611240404A CN 106686308 A CN106686308 A CN 106686308A
Authority
CN
China
Prior art keywords
target
picture
image
detected
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.)
Granted
Application number
CN201611240404.3A
Other languages
Chinese (zh)
Other versions
CN106686308B (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 an image focal length detection method. The method comprises the steps of obtaining a photographed to-be-detected picture, determining a target area where a target image is located in the to-be-detected picture through a pre-built image detection model, calculating the area proportion occupied by the target area in the to-be-detected picture and determining whether the focal length for photographing the to-be-detected picture meets the photographing requirement or not according to the area proportion. The invention further discloses an image focal length detection device. According to the image focal length detection method and device, automatic screening of pictures with the focal lengths which do not meet the requirement in the photographing process is achieved, and the difficulty of the pictures with the focal lengths which do not meet the requirement in the photographing process is lowered.

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 some require picture detail higher business scenario, the shooting distance of picture directly affects making for picture With value.Shooting distance picture too far wastes memory space but also meeting due to providing the detailed information of needs, not only Consume valuable computing resource.Therefore, carried out screening out shooting distance picture farther out before storage and processing business picture Just seem necessary, but the picture using artificial screening shooting distance farther out compares consumption manpower and material resources, and with figure The expansion of sheet data scale, the difficulty of screening can be increasing.
The content of the invention
Present invention is primarily targeted at providing 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.
For achieving the above object, a kind of image focal length detection method that the present invention is provided, described image focal distance detecting method Including:
The picture to be detected that acquisition has shot, by preset image detection model target in the picture to be detected is determined The target area that image is located;
Calculate the shared area ratio in the picture to be detected in the target area;
Determine whether the focal length for shooting the picture to be detected meets photographing request according to the area ratio.
Preferably, it is described to obtain the picture to be detected for having shot, determined by preset image detection model described to be checked The step of target area that target image is located in mapping piece, includes:
The picture described to be detected that acquisition has shot, by the picture to be detected the region of described image detection model is loaded into In generating 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 in the target detection network of described image detection model, to determine the candidate region In the target image be located target area.
Preferably, it is described that the candidate region is loaded in the target detection network of described image detection model, to determine Before the step of target area that the target image in the candidate region is located, also include:
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, by 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 the area ratio whether 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 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 shoot the focal length of the picture to be detected Meet photographing request.
Preferably, it is described to obtain the picture to be detected for having shot, determined by preset image detection model described to be checked Before the step of target area that target image is located in mapping piece, also include:
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;
The Area generation network after adjustment generates target area training data;
The target detection network of described image detection model is optimized according to the target area training data;
Determine the feature extraction layer of the Area generation network and the target detection network share, the fixation feature is carried Take layer.
Additionally, for achieving 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 for having shot, by preset image detection model institute is determined State the target area that target image is located in picture to be detected;
Computing module, the area ratio shared in the picture to be detected for calculating the target area;
Second determining module, for determining whether the focal length for shooting the picture to be detected meets according to the area ratio Photographing request.
Preferably, first determining module is additionally operable to obtain the picture described to be detected for having shot, will be described to be detected Picture is loaded in 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 into described image detection In the target detection network of model, to determine the candidate region in the target image be located target area.
Preferably, first determining module includes:
Acquiring unit, for obtaining described image detection model in reference zone corresponding with the target image;
Optimization unit, for calculating the mistake of target image position described in the candidate region and the reference zone Difference, according to the error, by Area generation network described in network optimization function optimization.
Preferably, second determining module includes:
Judging unit, for judging the area ratio whether less than predetermined threshold value;
Determining unit, if being less than the predetermined threshold value for the area ratio, it is determined that shoot the 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 treat 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, obtains The Area generation network after adjustment;
Generation module, for the Area generation network after adjustment target area training data is generated;
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 fixation feature extraction layer.
The present invention determines the mesh that target image is located in acquired picture to be detected by preset image detection model Mark region, calculates the shared area ratio in the picture to be detected in the target area, 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, reduces the difficulty of the undesirable picture of screening shooting process mid-focal length.
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 for having shot in the embodiment of the present invention, is determined by preset image detection model A kind of schematic flow sheet of the target area that target image is located in the picture to be detected;
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 of the object of the invention, functional characteristics and advantage will be described further referring to the drawings in conjunction with the embodiments.
Specific embodiment
It should be appreciated that specific embodiment described herein is not intended to limit the present invention only to explain the present invention.
The present invention provides a kind of image focal length detection method.
With reference to Fig. 1, Fig. 1 is 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, obtains the picture to be detected for having shot, and by preset image detection model the mapping to be checked is determined The target area that target image is located in piece.
When getting the picture to be detected that shot, it is thus necessary to determine that whether the focal length for shooting the picture to be detected meets use When family requires, acquisition pre-sets image detection model corresponding with the picture to be detected, true by the detection model The target area that target image is located in the fixed picture to be detected.It should be noted that the target image is described to be checked Primary articles to display in mapping piece, are a cars such as when the picture to be detected is to display, then described to be detected Car in picture is exactly the target image.Described image detection model pre-sets, and described image detection model can One target image of detection, it is also possible to detect multiple target images.As described image detection model may be configured as a detection car Image, or be set to detect image of car and people etc..
Further, during described image detection model is set, described image detection model is first collected to be detected Target image corresponding to picture set, wherein, the picture 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, the mark of the picture set is obtained Note information, the markup information of every pictures is stored in the form of a list in same file folder.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;May in second number for being classified as target image in every pictures, such as a pictures There are a car or many cars;Row behind secondary series represent the area of target image mark in every pictures in the picture set Domain, i.e., coordinate of the described target image in the picture, such as with the coordinate topLeft_x and topLeft_y in the upper left corner, and Bottom right angular coordinate bottomRight_x and bottomRight_y are represented.If it is understood that the 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 there are 4 column numbers to I haven't seen you for ages after the secondary series of the list, and described The number of the 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 The candidate region that target image is located in picture, the candidate region is that the target image can in the picture to be detected The rectangular area that can exist;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, For large-scale image procossing has outstanding performance.The basic structure of the convolutional neural networks includes two-layer, and one is characterized extraction Layer, the input of each neuron is connected with the local acceptance region of preceding layer, and extracts the feature of the local, once the local feature After being extracted, its position relationship and between further feature is also decided therewith;It two is Feature Mapping layer, each meter of network Calculate layer to be made up of multiple Feature Mapping, 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, obtains preset data corresponding with the target image that described image detection model can be detected;
Step b, adjusts the Area generation network of described image detection model, after being adjusted according to the preset data 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 input 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 according to the test result Area generation is adjusted Network, the Area generation network after being adjusted.In the present embodiment, the Area generation network is trained in order to reduce Time, can first to the Area generation netinit.
Step c, the Area generation network after adjustment generates target area training data;
Step d, according to the target area training data target detection network of described image detection model is optimized;
Step e, determines the feature extraction layer of the Area generation network and the target detection network share, fixed described Feature extraction layer.
After Area generation network after being adjusted, existed by the picture in the input 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, test result is obtained, 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, by institute The feature extraction layer for stating target detection network initializes the feature extraction layer of the Area generation network, the fixation Area generation The feature extraction layer of network.When the feature extraction layer of Area generation network is secured the above, by the Area generation network Feature extraction layer is copied in the target detection network, common with the fixed 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, Share multilamellar 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, calculates the shared area ratio in the picture to be detected in the target area.
When it is determined that target image in the picture to be detected be located target area after, calculate 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 the shared area ratio in the picture to be detected in target area.
Step S30, determines whether the focal length for shooting the picture to be detected meets photographing request according to the area ratio.
When it is determined that after the area ratio shared in the picture to be detected in the target area, according to the area ratio It is determined that whether the focal length for shooting the picture to be detected meets photographing request.
Further, step S30 includes:
Whether step f, judge the area ratio less than predetermined threshold value;
Step g, if the area ratio is less than the predetermined threshold value, it is determined that shoot the focal length of the picture to be detected not Meet photographing request;
Step h, if the area ratio is more than or equal to the predetermined threshold value, it is determined that shoot the picture to be detected Focal length meet photographing request.
Determine whether the focal length for shooting the picture to be detected meets the concrete mistake of photographing request according to the area ratio Cheng Wei:Whether the area ratio is judged less than predetermined threshold value, wherein, the predetermined threshold value is arranged for the concrete needs of basis, 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 shooting described The focal length of picture to be detected does not meet shooting and asks;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, information is exported, point out user to shoot the hypertelorism of the picture to be detected, need to re-shoot institute State picture to be detected;When it is determined that the focal length for shooting the picture to be detected meets photographing request, information is exported, point out to use Picture described to be detected captured by family meets photographing request, and stores the picture to be detected.
The present embodiment determines target image place in acquired picture to be detected by preset image detection model Target area, calculates the shared area ratio in the picture to be detected in the target area, true according to the area ratio Whether the focal length for shooting the picture to be detected surely meets photographing request.Realize automatic screening shooting process mid-focal length not meeting The picture of requirement, reduces the difficulty of the undesirable picture of screening shooting process mid-focal length.
Further, the preferred embodiment based on image focal length detection method of the present invention proposes another enforcement of the present invention Example, with reference to Fig. 2, in the present embodiment, step S10 includes:
Step S11, obtains the picture described to be detected for having shot, and the picture to be detected is loaded into 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 It is convolutional neural networks that domain generates network;
Step S12, the candidate region is loaded in the target detection network of described image detection model, described to determine The target area that the target image in candidate region is located.
When the picture to be detected for having shot is got, the picture to be detected is loaded into 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 be loaded into described image detection model target detection network in, to determine the candidate region in the target image The target area at place.In the present embodiment, the candidate region in the picture to be detected has one or more, and each is waited 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 for determining the target area that the target image is located, the Area generation net Network and the target detection network sharing features extract layer,
The detailed process for determining the target area that the target image is located is:The Area generation network last Little convolutional network of one input dimension for n x n is set in the Feature Mapping exported in individual convolutional layer.It should be noted that institute State the dimension N x N (ns and N of the dimension n x n less than last convolutional layer of the Area generation network of convolutional network For positive integer), will the Area generation network the area maps that covered of last convolutional layer to a more low dimensional Feature Mapping layer on.The Feature Mapping layer the be fully connected layer parallel with two connects.In the present embodiment, the two are complete Full articulamentum is referred to as cls layers and reg layers.The cls layers be used to determining in the candidate region containing target image can Energy property, i.e., containing the probability containing target image in the candidate region, the reg layers are used to determine institute in the candidate region The position at target image place is stated, to determine size and the displacement of the target image.Such as when the little convolutional network dimension sets When being set to 3x3, the Area generation network is the convolution kernel that a yardstick is 3x3, is output as 256 convolutional network layer, described Connect two complete convolutional layer cls layers and reg layers behind convolutional network layer.The convolution kernel of the 3x3 can be with 3 on each position Plant scaling and 3 kinds of wide height modes amount to candidate region described in 9 kinds of schema creations, be loaded in the target detection network with determining The size of target image and displacement in candidate region has robustness.
Further, before step S12, also include:
Step i, obtains reference zone corresponding with the target image in described image detection model;
Step j, calculates the error of target image position described in the candidate region and the reference zone, according to The error, by Area generation network described in network optimization function optimization.
It is determined that behind the candidate region, obtaining reference area corresponding with the target image in described image detection model Domain, the reference zone is 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 the position that logo image is located, and determine that target image institute is in place in the reference zone The top left co-ordinate put and bottom right angular coordinate.According in the candidate region target image be located position top left co-ordinate 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.Calculate the common factor between first scope and second scope, and calculating described first Union between scope and second scope, by the common factor divided by the union, obtains the candidate region and the ginseng Error described in the domain of examination district between target image position.The error is contrasted with default error, is judged described 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 arranged according to specific needs, and in the present embodiment, the default error is set to 0.7.
After the error is obtained, according to the error, by 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 of the set of candidate regions that multiple candidate regions are constituted, piIt is to deposit in i-th candidate region In the probability of target image.pi *The candidate region is represented whether containing 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, is determined by the error.tiIt is the target image of the Area generation neural network forecast in the candidate region Coordinate, be in form 4 dimensional vectors.DclsIt is the quantity of target image in the input candidate region, in the present embodiment In, Dcls=256, DregIt is that 3 kinds of numbers scaled with the new candidate region obtained after 3 kinds of aspect ratio transformations are done in the candidate region Amount, in the present embodiment, Dreg=256*9.λ is arranged to 10, and to balance the candidate region and the target area are determined Significance level.It is understood that in other embodiments, the Dcls、DregCan 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 In detection network, the target area that target image is located in the network to be detected is obtained, so as to according to the target area reality 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.
With reference to Fig. 3, Fig. 3 is the high-level schematic functional block diagram of image focal length detection means 100 of the present invention preferred embodiment.
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 aiding in understanding each of the image focal length detection means 100 Individual program function block, is not used in restriction technical scheme, and 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 for having shot, is determined by preset image detection model The target area that target image is located in the picture to be detected.
When getting the picture to be detected that shot, it is thus necessary to determine that whether the focal length for shooting the picture to be detected meets use When family requires, acquisition pre-sets image detection model corresponding with the picture to be detected, true by the detection model The target area that target image is located in the fixed picture to be detected.It should be noted that the target image is described to be checked Primary articles to display in mapping piece, are a cars such as when the picture to be detected is to display, then described to be detected Car in picture is exactly the target image.Described image detection model pre-sets, and described image detection model can One target image of detection, it is also possible to detect multiple target images.As described image detection model may be configured as a detection car Image, or be set to detect image of car and people etc..
Further, during described image detection model is set, described image detection model is first collected to be detected Target image corresponding to picture set, wherein, the picture 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, the mark of the picture set is obtained Note information, the markup information of every pictures is stored in the form of a list in same file folder.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;May in second number for being classified as target image in every pictures, such as a pictures There are a car or many cars;Row behind secondary series represent the area of target image mark in every pictures in the picture set Domain, i.e., coordinate of the described target image in the picture, such as with the coordinate topLeft_x and topLeft_y in the upper left corner, and Bottom right angular coordinate bottomRight_x and bottomRight_y are represented.If it is understood that the 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 there are 4 column numbers to I haven't seen you for ages after the secondary series of the list, and described The number of the 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 The candidate region that target image is located in picture, the candidate region is that the target image can in the picture to be detected The rectangular area that can exist;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, For large-scale image procossing has outstanding performance.The basic structure of the convolutional neural networks includes two-layer, and one is characterized extraction Layer, the input of each neuron is connected with the local acceptance region of preceding layer, and extracts the feature of the local, once the local feature After being extracted, its position relationship and between further feature is also decided therewith;It two is Feature Mapping layer, each meter of network Calculate layer to be made up of multiple Feature Mapping, 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, obtains 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 input 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 according to the test result Area generation is adjusted Network, the Area generation network after being adjusted.In the present embodiment, the Area generation network is trained in order to reduce Time, can first to the Area generation netinit.
Generation module, for the Area generation network after adjustment target area training data is generated;
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 fixation feature extraction layer.
After Area generation network after being adjusted, existed by the picture in the input 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, test result is obtained, 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, by institute The feature extraction layer for stating target detection network initializes the feature extraction layer of the Area generation network, the fixation Area generation The feature extraction layer of network.When the feature extraction layer of Area generation network is secured the above, by the Area generation network Feature extraction layer is copied in the target detection network, common with the fixed 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, Share multilamellar 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 target image in the picture to be detected be located target area after, calculate 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 the shared area ratio in the picture to be detected in target area.
Second determining module 30, for determining whether the focal length for shooting the picture to be detected accords with according to the area ratio Close photographing request.
When it is determined that after the area ratio shared in the picture to be detected in the target area, according to the area ratio It is determined that whether the focal length for shooting the picture to be detected meets photographing request.
Further, second determining module 30 includes:
Judging unit, for judging the area ratio whether less than predetermined threshold value;
Determining unit, if being less than the predetermined threshold value for the area ratio, it is determined that shoot the 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 treat 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 concrete mistake of photographing request according to the area ratio Cheng Wei:Whether the area ratio is judged less than predetermined threshold value, wherein, the predetermined threshold value is arranged for the concrete needs of basis, 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 shooting described The focal length of picture to be detected does not meet shooting and asks;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, information is exported, point out user to shoot the hypertelorism of the picture to be detected, need to re-shoot institute State picture to be detected;When it is determined that the focal length for shooting the picture to be detected meets photographing request, information is exported, point out to use Picture described to be detected captured by family meets photographing request, and stores the picture to be detected.
The present embodiment determines target image place in acquired picture to be detected by preset image detection model Target area, calculates the shared area ratio in the picture to be detected in the target area, true according to the area ratio Whether the focal length for shooting the picture to be detected surely meets photographing request.Realize automatic screening shooting process mid-focal length not meeting The picture of requirement, reduces the difficulty of the undesirable picture of screening shooting process mid-focal length.
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 described to be detected for having shot, treats described Detection picture is loaded in 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 into described image In the target detection network of detection model, to determine the candidate region in the target image be located target area.
When the picture to be detected for having shot is got, the picture to be detected is loaded into 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 be loaded into described image detection model target detection network in, to determine the candidate region in the target image The target area at place.In the present embodiment, the candidate region in the picture to be detected has one or more, and each is waited 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 for determining the target area that the target image is located, the Area generation net Network and the target detection network sharing features extract layer,
The detailed process for determining the target area that the target image is located is:The Area generation network last Little convolutional network of one input dimension for n x n is set in the Feature Mapping exported in individual convolutional layer.It should be noted that institute State the dimension N x N (ns and N of the dimension n x n less than last convolutional layer of the Area generation network of convolutional network For positive integer), will the Area generation network the area maps that covered of last convolutional layer to a more low dimensional Feature Mapping layer on.The Feature Mapping layer the be fully connected layer parallel with two connects.In the present embodiment, the two are complete Full articulamentum is referred to as cls layers and reg layers.The cls layers be used to determining in the candidate region containing target image can Energy property, i.e., containing the probability containing target image in the candidate region, the reg layers are used to determine institute in the candidate region The position at target image place is stated, to determine size and the displacement of the target image.Such as when the little convolutional network dimension sets When being set to 3x3, the Area generation network is the convolution kernel that a yardstick is 3x3, is output as 256 convolutional network layer, described Connect two complete convolutional layer cls layers and reg layers behind convolutional network layer.The convolution kernel of the 3x3 can be with 3 on each position Plant scaling and 3 kinds of wide height modes amount to candidate region described in 9 kinds of schema creations, be loaded in the target detection network with determining The size of target image and displacement in candidate region has robustness.
Further, first determining module 10 includes:
Acquiring unit, for obtaining described image detection model in reference zone corresponding with the target image;
Optimization unit, for calculating the mistake of target image position described in the candidate region and the reference zone Difference, according to the error, by Area generation network described in network optimization function optimization.
It is determined that behind the candidate region, obtaining reference area corresponding with the target image in described image detection model Domain, the reference zone is 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 the position that logo image is located, and determine that target image institute is in place in the reference zone The top left co-ordinate put and bottom right angular coordinate.According in the candidate region target image be located position top left co-ordinate 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.Calculate the common factor between first scope and second scope, and calculating described first Union between scope and second scope, by the common factor divided by the union, obtains the candidate region and the ginseng Error described in the domain of examination district between target image position.The error is contrasted with default error, is judged described 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 arranged according to specific needs, and in the present embodiment, the default error is set to 0.7.
After the error is obtained, according to the error, by 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 of the set of candidate regions that multiple candidate regions are constituted, piIt is to deposit in i-th candidate region In the probability of target image.pi *The candidate region is represented whether containing 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, is determined by the error.tiIt is the target image of the Area generation neural network forecast in the candidate region Coordinate, be in form 4 dimensional vectors.DclsIt is the quantity of target image in the input candidate region, in the present embodiment In, Dcls=256, DregIt is that 3 kinds of numbers scaled with the new candidate region obtained after 3 kinds of aspect ratio transformations are done in the candidate region Amount, in the present embodiment, Dreg=256*9.λ is arranged to 10, and to balance the candidate region and the target area are determined Significance level.It is understood that in other embodiments, the Dcls、DregCan 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 In detection network, the target area that target image is located in the network to be detected is obtained, so as to according to the target area reality Whether the focal length that existing automatic decision shoots the picture to be detected meets photographing request.
It should be noted that herein, term " including ", "comprising" or its any other variant are intended to non-row His property is included, so that a series of process, method, article or system including key elements not only include those key elements, and And also include 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 for being limited by sentence "including a ...", it is not excluded that including being somebody's turn to do Also there is other identical element 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 by 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 realizing, naturally it is also possible to by hardware, but in many cases the former is more preferably embodiment.It is based on Such understanding, the part that technical scheme substantially contributes in other words to prior art can be with software product Form embody, the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disc, CD), including Some instructions are used so that a station terminal equipment (can be mobile phone, computer, server, or network equipment etc.) performs this Method described in bright each embodiment.
The preferred embodiments of the present invention are these are only, the scope of the claims of the present invention is not thereby limited, it is every using this Equivalent structure or equivalent flow conversion that bright description 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 (10)

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 that acquisition has shot, by preset image detection model target image in the picture to be detected is determined The target area at place;
Calculate the shared area ratio in the picture to be detected in the target area;
Determine whether the focal length for shooting the picture to be detected meets photographing request according to the area ratio.
2. image focal length detection method as claimed in claim 1, it is characterised in that the mapping to be checked that the acquisition has shot Piece, wraps the step of determine the target area that target image in the picture to be detected is located by preset image detection model Include:
The picture described to be detected that acquisition has shot, by the picture to be detected the Area generation of described image detection model is loaded into 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;
By the candidate region be loaded into described image detection model target detection network in, to determine the candidate region in The target area that the target image is located.
3. image focal length detection method as claimed in claim 2, it is characterised in that it is described the candidate region is loaded into it is described In the target detection network of image detection model, to determine the candidate region in the target image be located target area The step of before, also include:
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, By Area generation network described in network optimization function optimization.
4. image focal length detection method as claimed in claim 1, it is characterised in that it is described determined according to the area ratio clap The step of whether focal length for taking the photograph the picture to be detected meets photographing request includes:
Judge the area ratio whether 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 for shooting the picture to be detected meets Photographing request.
5. the image focal length detection method as described in any one of Claims 1-4, it is characterised in that what the acquisition had shot Picture to be detected, by preset image detection model the target area that target image is located in the picture to be detected is determined Before step, also include:
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;
The Area generation network after adjustment generates target area training data;
The target detection network of described image detection model is optimized according to the target area training data;
Determine the feature extraction layer of the Area generation network and the target detection network share, the fixation feature extraction Layer.
6. 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 for having shot, by treating described in preset image detection model determination The target area that target image is located in detection picture;
Computing module, the area ratio shared in the picture to be detected for calculating the target area;
Second determining module, for determining whether the focal length for shooting the picture to be detected meets shooting according to the area ratio Require.
7. image focal length detection means as claimed in claim 6, it is characterised in that first determining module is additionally operable to obtain The picture described to be detected for having shot, the picture to be detected is loaded in the Area generation network of described image detection model, To determine candidate region of the target image in the picture to be detected, wherein, the Area generation network is convolution god Jing networks;The candidate region is loaded in the target detection network of described image detection model, to determine the candidate region In the target image be located target area.
8. image focal length detection means as claimed in claim 7, it is characterised in that first determining module includes:
Acquiring unit, for obtaining described image detection model in reference zone corresponding with the target image;
Optimization unit, for calculating the error of target image position described in the candidate region and the reference zone, According to the error, by Area generation network described in network optimization function optimization.
9. image focal length detection means as claimed in claim 6, it is characterised in that second determining module includes:
Judging unit, for judging the area ratio whether less than predetermined threshold value;
Determining unit, if being less than the predetermined threshold value for the area ratio, it is determined that shoot Jiao of the 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 shoot described to be detected The focal length of picture meets photographing request.
10. the image focal length detection means as described in any one of claim 6 to 9, it is characterised in that described image focal length is detected 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, is adjusted The Area generation network afterwards;
Generation module, for the Area generation network after adjustment target area training data is generated;
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 fixation 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 true CN106686308A (en) 2017-05-17
CN106686308B 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 (7)

* 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
CN113242387A (en) * 2021-06-11 2021-08-10 广州立景创新科技有限公司 Camera module, focusing adjustment system and focusing method
US11095902B2 (en) 2019-06-28 2021-08-17 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method for image coding, electronic device and computer-readable storage medium
US11178324B2 (en) 2019-06-28 2021-11-16 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Focusing method and device, electronic device and computer-readable storage medium
TWI774418B (en) * 2021-06-11 2022-08-11 大陸商廣州立景創新科技有限公司 Camera module, focus adjustment system and focusing method
US11457138B2 (en) 2019-06-28 2022-09-27 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method and device for image processing, method for training object detection model
US11538175B2 (en) 2019-09-29 2022-12-27 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method and apparatus for detecting subject, electronic device, and computer readable storage medium

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110770739A (en) * 2018-10-31 2020-02-07 深圳市大疆创新科技有限公司 Control method, device and control equipment based on image recognition
CN110456829B (en) * 2019-08-07 2022-12-13 深圳市维海德技术股份有限公司 Positioning tracking method, device and computer readable storage medium
CN110796041B (en) 2019-10-16 2023-08-18 Oppo广东移动通信有限公司 Principal identification 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
CN113096077B (en) * 2021-03-25 2024-05-03 深圳力维智联技术有限公司 Abnormal proportion detection method, device, equipment and computer readable storage medium

Citations (5)

* 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
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
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 (7)

* 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
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 (5)

* 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
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
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 (7)

* 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
US11095902B2 (en) 2019-06-28 2021-08-17 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method for image coding, electronic device and computer-readable storage medium
US11178324B2 (en) 2019-06-28 2021-11-16 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Focusing method and device, electronic device and computer-readable storage medium
US11457138B2 (en) 2019-06-28 2022-09-27 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method and device for image processing, method for training object detection model
US11538175B2 (en) 2019-09-29 2022-12-27 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method and apparatus for detecting subject, electronic device, and computer readable storage medium
CN113242387A (en) * 2021-06-11 2021-08-10 广州立景创新科技有限公司 Camera module, focusing adjustment system and focusing method
TWI774418B (en) * 2021-06-11 2022-08-11 大陸商廣州立景創新科技有限公司 Camera module, focus adjustment system and focusing method

Also Published As

Publication number Publication date
TW201841491A (en) 2018-11-16
WO2018120460A1 (en) 2018-07-05
CN106686308B (en) 2018-02-16
TWI658730B (en) 2019-05-01

Similar Documents

Publication Publication Date Title
CN106686308A (en) Image focal length detection method and device
CN109978035B (en) Pedestrian detection method based on improved k-means and loss function
CN110490202A (en) Detection model training method, device, computer equipment and storage medium
JP2019536120A (en) System and method for verifying authenticity of ID photo
CN107690660A (en) Image-recognizing method and device
CN112668573B (en) Target detection position reliability determination method and device, electronic equipment and storage medium
CN109902629A (en) A kind of real-time vehicle target detection model under vehicles in complex traffic scene
CN112818995B (en) Image classification method, device, electronic equipment and storage medium
CN114170531B (en) Infrared image target detection method and device based on difficult sample transfer learning
CN114821823B (en) Image processing, training of human face anti-counterfeiting model and living body detection method and device
CN113177579A (en) Feature fusion method based on attention mechanism
CN114549959A (en) Infrared dim target real-time detection method and system based on target detection model
CN113723352A (en) Text detection method, system, storage medium and electronic equipment
CN116522565B (en) BIM-based power engineering design power distribution network planning method and computer equipment
CN110866866B (en) Image color imitation processing method and device, electronic equipment and storage medium
CN115112661B (en) Defect detection method, device, computer equipment and storage medium
CN116797830A (en) Image risk classification method and device based on YOLOv7
CN110705398A (en) Mobile-end-oriented test paper layout image-text real-time detection method
CN116977271A (en) Defect detection method, model training method, device and electronic equipment
CN116310899A (en) YOLOv 5-based improved target detection method and device and training method
CN114925153A (en) Service-based geographic information data quality detection method, device and equipment
KR101972095B1 (en) Method and Apparatus of adding artificial object for improving performance in detecting object
CN111583168A (en) Image synthesis method, image synthesis device, computer equipment and storage medium
CN115965856B (en) Image detection model construction method, device, computer equipment and storage medium
CN112132223B (en) Method, device, equipment and storage medium for pooling

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