CN109657603A - The method and device of Face datection - Google Patents

The method and device of Face datection Download PDF

Info

Publication number
CN109657603A
CN109657603A CN201811541438.5A CN201811541438A CN109657603A CN 109657603 A CN109657603 A CN 109657603A CN 201811541438 A CN201811541438 A CN 201811541438A CN 109657603 A CN109657603 A CN 109657603A
Authority
CN
China
Prior art keywords
window
cutting
size
mentioned
data
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
CN201811541438.5A
Other languages
Chinese (zh)
Other versions
CN109657603B (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.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies 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 Shenzhen Intellifusion Technologies Co Ltd filed Critical Shenzhen Intellifusion Technologies Co Ltd
Priority to CN201811541438.5A priority Critical patent/CN109657603B/en
Publication of CN109657603A publication Critical patent/CN109657603A/en
Application granted granted Critical
Publication of CN109657603B publication Critical patent/CN109657603B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the present application discloses a kind of method and device of Face datection, this method comprises: obtaining image processing data, described image processing information includes sliding window window information and image cutting information;It cuts information according to described image to cut image to be detected data, N part cutting data after being cut;The N parts of cutting data is obtained respectively, and N parts of cutting datas are carried out sweeping window based on window indicated by the sliding window window information, each detected value for sweeping window region in the N parts of cutting datas is obtained, is determined according to each detected value for sweeping window region and described each sweeps whether window region has face.Using the embodiment of the present application, the occupancy to hardware resource can be reduced, improves hardware resource utilization, flexibility is high, strong applicability.

Description

The method and device of Face datection
Technical field
This application involves field of image processing more particularly to a kind of method and devices of Face datection.
Background technique
Vision is the main means that the mankind obtain information.It is counted according to correlative study, the mankind is accounted for by the information that vision obtains Obtain 70% or more of informational capacity;On the other hand, with the raising at full speed of computer hardware performance, using computer come auxiliary Help, simulate the research of human vision to obtain extensive concern.
People in image is often the center of whole image, and according to the visual characteristic of human eye, people are usually in image The face area of people is interested.The processing and analysis of face include recognition of face, face tracking, pose estimation and Expression Recognition Deng wherein Face datection is concerned as one step of key in all face information processings.In the prior art due to hardware Storage resource be limited, therefore be directed to large-size images Face datection algorithm, it is how limited in hardware store resource In the case of storing data become current urgent problem to be solved.
Summary of the invention
The embodiment of the present application provides a kind of method and device of Face datection, it can be achieved that in the insufficient situation of hardware resource Face datection is carried out to large-size images, reduces the occupancy to hardware resource.
In a first aspect, the embodiment of the present application provides a kind of method of Face datection, this method comprises:
Image processing data is obtained, above-mentioned image processing data includes sliding window window information and image cutting information;
It cuts information according to above-mentioned image to cut image to be detected data, N part cutting data after being cut;
The 1st part of cutting data in above-mentioned N parts of cutting data is obtained, and based on window indicated by above-mentioned sliding window window information It mouthful carries out sweeping window since the starting point of above-mentioned 1st part of cutting data, obtains each window region of sweeping in above-mentioned 1st part of cutting data Detected value determines according to above-mentioned each detected value for sweeping window region and above-mentioned each sweeps whether window region has face;
A+1 parts of cutting datas after above-mentioned 1st part of cutting data are obtained, and signified based on above-mentioned sliding window window information The window shown since above-mentioned a parts of cutting datas sweep window end position from above-mentioned a+1 parts of cutting datas are carried out sweeping window, Each detected value for sweeping window region in above-mentioned a+1 parts of cutting datas is obtained, it is true according to above-mentioned each detected value for sweeping window region It is fixed above-mentioned each to sweep whether window region has face, wherein a is greater than 0 and to be less than the integer of N.
It with reference to first aspect, include N group cutting ginseng in above-mentioned image cutting information in a kind of possible embodiment Number, wherein i-th group of cutting parameter is used to indicate the cutting mode of i-th part of cutting data;It is above-mentioned that information is cut according to above-mentioned image Image to be detected data are cut, N part cutting data after being cut, comprising:
Obtain image to be detected data;
According to cutting mode indicated by each group cutting parameter in above-mentioned N group cutting parameter to above-mentioned image to be detected number According to image data cutting is carried out, N parts of cutting datas are obtained.
With reference to first aspect, in a kind of possible embodiment, above-mentioned sliding window window information includes window size and window Mouth step-length, above-mentioned window size includes multiple sizes, wherein the corresponding size window of a size, a size window pair Answer a window step length;
The above method further include:
The full-size window in the corresponding multiple size windows of above-mentioned multiple sizes is obtained, by above-mentioned full-size window As first size window, wherein first size window corresponds to first window step-length;
The 1st group of cutting parameter is determined according to the image col width of above-mentioned first size window and above-mentioned image to be detected;
It is determined according to the image col width of above-mentioned first window step-length and above-mentioned image to be detected and removes above-mentioned 1st group of cutting parameter Except other N-1 group cutting parameters to obtain above-mentioned N group cutting parameter.
With reference to first aspect, in a kind of possible embodiment, above-mentioned sliding window window information includes window size and window Mouth step-length, wherein above-mentioned window size includes at least first size and the second size, and above-mentioned first size corresponds to first size window Mouthful, corresponding second size window of above-mentioned second size, above-mentioned first size window corresponds to first window step-length, above-mentioned second size Window corresponds to the second window step length;
It is above-mentioned to be carried out since the starting point of above-mentioned 1st part of cutting data based on window indicated by above-mentioned sliding window window information Window is swept, each detected value for sweeping window region in above-mentioned 1st part of cutting data is obtained, comprising:
It is cut according to the distance for moving above-mentioned first window step-length every time from above-mentioned 1st part using above-mentioned first size window Cut data starting point start carry out from left to right, from top to bottom sweep window, obtain first size window in above-mentioned 1st part of cutting data Each detected value for sweeping window region that mouth is passed through;
It is cut according to the distance for moving above-mentioned second window step length every time from above-mentioned 1st part using above-mentioned second size window Cut data starting point start carry out from left to right, from top to bottom sweep window, obtain the second size window in above-mentioned 1st part of cutting data Each detected value for sweeping window region that mouth is passed through;
By each detected value for sweeping window region and above-mentioned that first size window is passed through in above-mentioned 1st part of cutting data Each detected value for sweeping window region that the second size window is passed through in 1 part of cutting data is determined as above-mentioned 1st part of cutting data In each detected value for sweeping window region.
With reference to first aspect, in a kind of possible embodiment, when above-mentioned first size window sweeps window to above-mentioned a parts Any data swept in window region and above-mentioned first size window on cutting data are less than the size of above-mentioned first size window When, record above-mentioned first size window sweep window to it is any of the above-described sweep window region when first stop on above-mentioned a parts of cutting datas Stay position;
When what above-mentioned second size window was swept on window to above-mentioned a parts of cutting datas any sweeps window region and above-mentioned second ruler When data in very little window are less than the size of above-mentioned second size window, record above-mentioned second size window and sweep window to any of the above-described The second stop place when sweeping window region on above-mentioned a parts of cutting datas;
The window of sweeping that above-mentioned first stop place and above-mentioned second stop place are determined as above-mentioned a parts of cutting datas is terminated Position.
With reference to first aspect, above-mentioned based on indicated by above-mentioned sliding window window information in a kind of possible embodiment Window since above-mentioned a parts of cutting datas sweep window end position from above-mentioned a+1 parts of cutting datas are carried out sweeping window, obtain Each detected value for sweeping window region in above-mentioned a+1 parts of cutting datas, comprising:
Stopped according to the distance for moving above-mentioned first window step-length every time from above-mentioned first using above-mentioned first size window Stay start at position to above-mentioned a+1 parts of cutting datas carry out from left to right, from top to bottom sweep window, obtain above-mentioned a+1 parts Each detected value for sweeping window region that first size window is passed through in cutting data;
Stopped according to the distance for moving above-mentioned second window step length every time from above-mentioned second using above-mentioned second size window Stay start at position to above-mentioned a+1 parts of cutting datas carry out from left to right, from top to bottom sweep window, obtain above-mentioned a+1 parts Each detected value for sweeping window region that the second size window is passed through in cutting data;
By first size window is passed through in above-mentioned a+1 parts of cutting datas each detected value for sweeping window region and above-mentioned Each detected value for sweeping window region that the second size window is passed through in a+1 parts of cutting datas is determined as above-mentioned a+1 parts and cuts Cut each detected value for sweeping window region in data.
With reference to first aspect, above-mentioned according to above-mentioned each detected value for sweeping window region in a kind of possible embodiment It determines and above-mentioned each sweeps whether window region has face, comprising:
If the size of the more above-mentioned each detected value for sweeping window region and preset value each sweeps any in window region sweep above-mentioned The detected value in window region is more than or equal to above-mentioned preset value, determines that there is face in any of the above-described window region of sweeping.
Second aspect, the embodiment of the present application provide a kind of device of Face datection, which includes:
Information acquisition unit, for obtaining image processing data, above-mentioned image processing data include sliding window window information and Image cuts information;
Data cutter unit, the above-mentioned image cutting information for being determined according to above- mentioned information acquiring unit is to figure to be detected As data are cut, N part cutting data after being cut;
Cutting data processing unit, for obtaining the 1st in the above-mentioned N parts of cutting datas that above-mentioned data cutter unit determines Part cutting data, and based on window indicated by above-mentioned sliding window window information since the starting point of above-mentioned 1st part of cutting data into Row sweeps window, each detected value for sweeping window region in above-mentioned 1st part of cutting data is obtained, according to above-mentioned each detection for sweeping window region Value, which determines, above-mentioned each sweeps whether window region has face;
Above-mentioned cutting data processing unit is also used to obtain the above-mentioned 1st part of cutting number that above-mentioned data cutter unit determines According to a+1 parts of cutting datas later, and based on window indicated by above-mentioned sliding window window information from above-mentioned a parts of cutting datas Sweep and start that above-mentioned a+1 parts of cutting datas are carried out sweeping window at window end position, obtain each in above-mentioned a+1 parts of cutting datas A detected value for sweeping window region, according to above-mentioned each detected value for sweeping window region determine it is above-mentioned it is each sweep window region whether someone Face, wherein a is the integer greater than 0 and less than N.
It include N group cutting ginseng in above-mentioned image cutting information in a kind of possible embodiment in conjunction with second aspect Number, wherein i-th group of cutting parameter is used to indicate the cutting mode of i-th part of cutting data;Above-mentioned data cutter unit is used for:
Obtain image to be detected data;
According to cutting mode indicated by each group cutting parameter in above-mentioned N group cutting parameter to above-mentioned image to be detected number According to image data cutting is carried out, N parts of cutting datas are obtained.
In conjunction with second aspect, in a kind of possible embodiment, above-mentioned sliding window window information includes window size and window Mouth step-length, above-mentioned window size includes multiple sizes, wherein the corresponding size window of a size, a size window pair Answer a window step length;Above-mentioned human face detection device further include:
Cutting parameter determination unit, for obtaining the full-size window in the corresponding multiple size windows of above-mentioned multiple sizes Mouthful, using above-mentioned full-size window as first size window, wherein first size window corresponds to first window step-length;
The 1st group of cutting parameter is determined according to the image col width of above-mentioned first size window and above-mentioned image to be detected;
It is determined according to the image col width of above-mentioned first window step-length and above-mentioned image to be detected and removes above-mentioned 1st group of cutting parameter Except other N-1 group cutting parameters to obtain above-mentioned N group cutting parameter.
In conjunction with second aspect, in a kind of possible embodiment, above-mentioned sliding window window information includes window size and window Mouth step-length, wherein above-mentioned window size includes at least first size and the second size, and above-mentioned first size corresponds to first size window Mouthful, corresponding second size window of above-mentioned second size, above-mentioned first size window corresponds to first window step-length, above-mentioned second size Window corresponds to the second window step length;Above-mentioned cutting data processing unit is used for:
It is cut according to the distance for moving above-mentioned first window step-length every time from above-mentioned 1st part using above-mentioned first size window Cut data starting point start carry out from left to right, from top to bottom sweep window, obtain first size window in above-mentioned 1st part of cutting data Each detected value for sweeping window region that mouth is passed through;
It is cut according to the distance for moving above-mentioned second window step length every time from above-mentioned 1st part using above-mentioned second size window Cut data starting point start carry out from left to right, from top to bottom sweep window, obtain the second size window in above-mentioned 1st part of cutting data Each detected value for sweeping window region that mouth is passed through;
By each detected value for sweeping window region and above-mentioned that first size window is passed through in above-mentioned 1st part of cutting data Each detected value for sweeping window region that the second size window is passed through in 1 part of cutting data is determined as above-mentioned 1st part of cutting data In each detected value for sweeping window region.
In conjunction with second aspect, in a kind of possible embodiment, above-mentioned human face detection device further include:
Stop place determination unit, for sweeping appointing on window to above-mentioned a parts of cutting datas when above-mentioned first size window When sweeping data in window region and above-mentioned first size window and being less than the size of above-mentioned first size window, above-mentioned first is recorded Size window sweep window to it is any of the above-described sweep window region when the first stop place on above-mentioned a parts of cutting datas;
When what above-mentioned second size window was swept on window to above-mentioned a parts of cutting datas any sweeps window region and above-mentioned second ruler When data in very little window are less than the size of above-mentioned second size window, record above-mentioned second size window and sweep window to any of the above-described The second stop place when sweeping window region on above-mentioned a parts of cutting datas;
The window of sweeping that above-mentioned first stop place and above-mentioned second stop place are determined as above-mentioned a parts of cutting datas is terminated Position.
In conjunction with second aspect, in a kind of possible embodiment, above-mentioned cutting data processing unit is also used to:
Stopped according to the distance for moving above-mentioned first window step-length every time from above-mentioned first using above-mentioned first size window Stay start at position to above-mentioned a+1 parts of cutting datas carry out from left to right, from top to bottom sweep window, obtain above-mentioned a+1 parts Each detected value for sweeping window region that first size window is passed through in cutting data;
Stopped according to the distance for moving above-mentioned second window step length every time from above-mentioned second using above-mentioned second size window Stay start at position to above-mentioned a+1 parts of cutting datas carry out from left to right, from top to bottom sweep window, obtain above-mentioned a+1 parts Each detected value for sweeping window region that the second size window is passed through in cutting data;
By first size window is passed through in above-mentioned a+1 parts of cutting datas each detected value for sweeping window region and above-mentioned Each detected value for sweeping window region that the second size window is passed through in a+1 parts of cutting datas is determined as above-mentioned a+1 parts and cuts Cut each detected value for sweeping window region in data.
In conjunction with second aspect, in a kind of possible embodiment, above-mentioned cutting data processing unit is also used to:
If the size of the more above-mentioned each detected value for sweeping window region and preset value each sweeps any in window region sweep above-mentioned The detected value in window region is more than or equal to above-mentioned preset value, determines that there is face in any of the above-described window region of sweeping.
The third aspect, the embodiment of the present application provide a kind of terminal device, which includes processor and memory, The processor and memory are connected with each other.The memory for store support the terminal device execute above-mentioned first aspect and/or The computer program for the method that any possible implementation of first aspect provides, which includes program instruction, The processor is configured for calling above procedure instruction, executes above-mentioned first aspect and/or first aspect is any possible Method provided by embodiment.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, the computer-readable storage medium Matter is stored with computer program, which includes program instruction, which makes at this when being executed by a processor It manages device and executes method provided by above-mentioned first aspect and/or any possible embodiment of first aspect.
Implement the embodiment of the present application, has the following beneficial effects:
By being cut to large-size images data, so that every part of cutting data and whole image data phase after cutting Reduce than data volume, and then the space of shared hardware resource is also reduced, then every part of cutting data after processing cutting several times, It can be achieved to carry out Face datection to large-size images in the insufficient situation of hardware resource, reduce the occupancy to hardware resource, mention High hardware resource utilization, flexibility is high, strong applicability.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a flow diagram of method for detecting human face provided by the embodiments of the present application;
Fig. 2 is an application scenarios schematic diagram of cutting image to be detected data provided by the embodiments of the present application;
Fig. 3 is an application scenarios schematic diagram provided by the embodiments of the present application for sweeping window process;
Fig. 4 is an application scenarios schematic diagram provided by the embodiments of the present application for recording and sweeping window end position;
Fig. 5 is an application scenarios schematic diagram of method for detecting human face provided by the embodiments of the present application;
Fig. 6 is the structural schematic diagram of human face detection device provided by the embodiments of the present application;
Fig. 7 is the structural schematic diagram of terminal device provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall in the protection scope of this application.
The method of Face datection provided by the embodiments of the present application is widely portable to server and/or the end of Face datection End equipment.Wherein, server can be to provide the server of various services, and terminal device can be hardware, be also possible to software. When terminal device is hardware, it can be the various electronic equipments with display screen, including but not limited to smart phone, plate electricity Brain, E-book reader, pocket computer on knee and desktop computer etc..When terminal device is software, can install In above-mentioned cited electronic equipment.Multiple softwares or software module may be implemented into (such as providing distributed clothes in it The multiple softwares or software module of business), single software or software module also may be implemented into.It is not specifically limited herein.When obtaining When getting image to be detected and needing to carry out Face datection to image to be detected, pass through the image in the image processing data of acquisition Information is cut, image to be detected data can be cut, more parts of cutting datas after being cut, by obtaining every time A cutting data in more parts of cutting datas is stated, and using the sliding window information in above-mentioned image processing data to every part of cutting number Window end position is swept according to sweep window and recording, each Face datection for sweeping window region in above-mentioned more parts of cutting datas can be obtained As a result.Using the embodiment of the present application, by being cut to large-size images data so that cutting after every part of cutting data with Whole image data reduces compared to data volume, and then the space of shared hardware resource is also reduced, then after processing cutting several times Every part of cutting data, it can be achieved that in the insufficient situation of hardware resource to large-size images carry out Face datection, reduce to hardware The occupancy of resource improves hardware resource utilization, and flexibility is high, strong applicability.
Method provided by the embodiments of the present application and relevant apparatus are carried out respectively respectively below in conjunction with Fig. 1 to Fig. 7 in detail Explanation.May include in method provided by the embodiments of the present application for obtain image processing data, cutting image to be detected data, with And cutting data is carried out based on sliding window window information to sweep the data processing stages such as window.Wherein, above-mentioned each data processing stage Implementation can be found in the implementation being illustrated in fig. 1 shown below.
Referring to Fig. 1, Fig. 1 is a flow diagram of method for detecting human face provided by the embodiments of the present application.The application is implemented The method that example provides may include steps of 101 to 104:
101, image processing data is obtained, above-mentioned image processing data includes sliding window window information and image cutting information.
In some possible embodiments, Face datection refers to the image given for any one width, using certain Strategy scans for it to determine whether containing face.The algorithm of Face datection includes but is not limited to PICO (PixelI NtensityComparisonsOrganized, tissue pixels intensity compare) algorithm, NPD (NormalizedPixelDifference normalizes pixel difference) algorithm etc., can specifically determine according to practical application scene, This is with no restrictions.By the training to Face datection algorithm, the sliding window window information for Face datection can be obtained.It is needing When carrying out Face datection to image to be detected, the available sliding window window information obtained by training.According to above-mentioned sliding window window The indicated window of message breath carries out sweeping window to image to be detected data after cutting.Wherein, above-mentioned sliding window window information includes Window size and window step length include multiple sizes in above-mentioned window size.It is understood that a size indicates one The size of size window, a size window have corresponded to a window step length.It, below will be in multiple sizes for convenience of description It is illustrated for two sizes (being assumed to be first size and the second size).
As an example it is assumed that the window size in the sliding window window information obtained includes at least first size and the second ruler It is very little, then, the corresponding window of first size is first size window, and the corresponding window of the second size is then the second size window, And first size window corresponds to first window step-length, corresponding second window step length of the second size window.
In some possible embodiments, when carrying out Face datection to image to be detected, ideally if hardware Storage resource is sufficiently large, then can all store the algorithm parameter for being used for Face datection and image to be detected data.This In, image to be detected is made of image to be detected data.It is understood that in practical application scene, hardware store money Source is limited, and is difficult disposably all to store all parameters and data.Therefore, the embodiment of the present application is by will be to be detected Image data is divided into more parts of cutting datas and is handled again, can achieve the purpose that image to be detected carry out Face datection but also Solve the problems, such as storage resource deficiency.Here, image cutting information can serve to indicate that the cutting of cutting image to be detected data Mode, above-mentioned cutting mode include the line width and col width and cut direction of cutting data, and above-mentioned cut direction includes laterally cutting Cut with it is longitudinally cutting.Cut direction in the embodiment of the present application is all transverse cuts.Assuming that including N in above-mentioned image cutting information Group cutting parameter, then, i-th group of cutting parameter can serve to indicate that the cutting mode of i-th part of cutting data.In other words, on It states i-th group of cutting parameter to indicate when cutting image to be detected data, the line width and column of i-th part of cutting data of cutting Wide and cut direction, that is to say, that above-mentioned i-th group of cutting parameter can indicate that cutting i-th part in image to be detected data cuts Cutting starting point and cutting end point when cutting data.Wherein, N is positive integer, and the size of N is determined according to practical application scene, This is with no restrictions.
102, it cuts information according to above-mentioned image to cut image to be detected data, N part cutting after being cut Data.
In some possible embodiments, image to be detected data can be expressed as image line width × image col width.It is logical The full-size window obtained in the corresponding multiple size windows of multiple sizes is crossed, it can be using above-mentioned full-size window as One size window, wherein first size window corresponds to first window step-length.According to above-mentioned first size window and image to be detected The image col width of data, can determine the 1st part of cutting data indicated by above-mentioned 1st group of cutting parameter line width and col width and Cut direction, i.e. cutting starting point and cutting end point when cutting the 1st part of cutting data in image to be detected data.According to above-mentioned The image col width of first window step-length and image to be detected data can determine other in addition to above-mentioned 1st group of cutting parameter The line width Yu col width and cut direction of each part cutting data indicated by N-1 group cutting parameter, i.e., in image to be detected data Cutting starting point and cutting end point when the 2nd part~N parts of cutting datas of upper cutting.
As an example it is assumed that image to be detected is the image of 720p, i.e. the image line width of image to be detected is 720, to be checked The image col width of altimetric image is 1280, then the size of image to be detected data is represented by 720 × 1280.Get sliding window window Window size in message breath includes first size and the second size, and window step length includes first window step-length and the second window step It is long.Wherein, the corresponding first size window of first size is greater than corresponding second size window of the second size.If first size The size of window is 300 × 300, and the size of the second size window is 180 × 180, and first window step-length is 84, the second window step A length of 60, then image cuts the line width and col width of cutting mode cutting data indicated by the 1st group of cutting parameter in information It is represented by first size × image col width, i.e., 300 × 1280, image is cut in information in addition to above-mentioned 1st group of cutting parameter Other N-1 group cutting parameters indicated by cutting mode cutting data line width and col width be represented by first window step-length × Image col width, i.e., 84 × 1280, wherein cut direction is transverse cuts.
Optionally, in some possible embodiments, every group in the N group cutting parameter in above-mentioned image cutting information Cutting parameter can also be different from.If cut direction is transverse cuts, cutting side indicated by the 1st group of cutting parameter The line width for the 1st part of cutting data that formula is cut should at least meet with col width more than or equal to first size × to be detected The image col width of image data.
For example, referring to fig. 2, Fig. 2 is an application of cutting image to be detected data provided by the embodiments of the present application Schematic diagram of a scenario.Assuming that getting the image that image to be detected is 720p, i.e. the image line width of image to be detected is 720, to be checked The image col width of altimetric image is 1280, then the size of image to be detected data is represented by image line width × image col width, i.e., 720×1280.Assuming that 6 groups of cutting parameters are got, wherein the cut direction in cutting mode indicated by the 1st group of cutting parameter For transverse cuts, the line width and col width of cutting data are 300 × 1280, then cutting mapping to be checked according to the 1st group of cutting parameter As data, the 0th~299 row that the 1st part of cutting data is image to be detected data can be obtained.Indicated by 2nd~6 group of cutting parameter Cutting mode in cut direction be transverse cuts, the line width of each part cutting data and col width are all 84 × 1280.So root Image to be detected data are cut according to the 2nd group of cutting parameter, the 300th that the 2nd part of cutting data is image to be detected data can be obtained ~383 rows.Image to be detected data are cut according to the 3rd group of cutting parameter, it is image to be detected number that the 3rd part of cutting data, which can be obtained, According to the 384th~467 row.Cut image to be detected data according to the 4th group of cutting parameter, can be obtained the 4th part of cutting data be to 468th~551 row of detection image data.Image to be detected data are cut according to the 5th group of cutting parameter, available 5th part is cut Cut the 552nd~635 row that data are image to be detected data.Image to be detected data are cut according to the 6th group of cutting parameter, can be obtained It is the 636th~719 row of image to be detected data to the 6th part of cutting data.
103, the 1st part of cutting data in above-mentioned N parts of cutting data is obtained, and based on indicated by above-mentioned sliding window window information Window carry out sweeping window since the starting point of above-mentioned 1st part of cutting data, obtain each area Sao Chuan in above-mentioned 1st part of cutting data The detected value in domain determines according to above-mentioned each detected value for sweeping window region and above-mentioned each sweeps whether window region has face.
In some possible embodiments, to be detected to whole therefore, it is difficult to realize since hardware store resource is limited Image carries out the processing of Face datection again after being stored.The embodiment of the present application is by being cut into N parts for image to be detected data Cutting data and then the implementation handled every part of cutting data in N parts of cutting datas can efficiently solve The problem of hardware store inadequate resource.
In some possible embodiments, the 1st part of cutting data in above-mentioned N parts of cutting data is obtained, according to acquisition Sliding window window information indicated by window carry out sweeping window since the starting point of above-mentioned 1st part of cutting data, can obtain above-mentioned Each detected value for sweeping window region in 1st part of cutting data.Specifically, obtaining above-mentioned 1st part of cutting data, the first ruler is utilized Very little window is carried out since the starting point of above-mentioned 1st part of cutting data according to the distance of each mobile first window step-length from left past It is right, from top to bottom sweep window, can obtain that above-mentioned first size window in above-mentioned 1st part of cutting data passed through each sweeps window The detected value in region.It is cut according to the distance of each mobile second window step length from above-mentioned 1st part using the second size window The starting point of data start carry out from left to right, from top to bottom sweep window, obtain above-mentioned second size in above-mentioned 1st part of cutting data Each detected value for sweeping window region that window is passed through.By comparing the big of above-mentioned each detected value for sweeping window region and preset value It is small, it can determine and above-mentioned each sweep whether window region has face.If each any detection for sweeping window region in window region is swept above-mentioned Value is more than or equal to above-mentioned preset value, determines that there is face in any of the above-described window region of sweeping.
It for example, is an application scenarios schematic diagram provided by the embodiments of the present application for sweeping window process referring to Fig. 3, Fig. 3. In application scenes, the 1st part of cutting data, i.e. the 0th~299 row data are obtained, it is assumed that the size of X size window is M × M, X window step length is M', since the starting point (the 0th row) of above-mentioned 1st part of cutting data, with the size M of X size window × M according to each mobile X window step length (i.e. mobile M' every time) distance, to above-mentioned 1st part of cutting data carry out from It is left-to-right to sweep window.Wherein, X size window, which passes through one every time and sweeps window region, can obtain a detected value.When X size When window from left to right sweeps last column (the 1279th column) data of window to the 1st part of cutting data, an X window step length is moved down The distance of M', and continue from size M × M that the M' row of above-mentioned 1st part of cutting data starts with X size window according to every The distance of one X window step length of secondary movement (i.e. every time mobile M') carries out sweeping from left to right to above-mentioned 1st part of cutting data Window.Wherein, each detected value for sweeping window region that above-mentioned X size window is passed through can be obtained in the process by sweeping window.It will be above-mentioned Each detected value for sweeping window region is compared with the size of preset value, each sweeps any window region of sweeping in window region if above-mentioned Detected value is more than or equal to above-mentioned preset value, determines that there is face in any of the above-described window region of sweeping.
Optionally, in some possible embodiments, when carrying out sweeping window to a parts of cutting datas, one is often moved down The distance of X window step length (i.e. mobile M' every time), it is thus necessary to determine that X size window is swept on window to above-mentioned a parts of cutting datas The data swept in window region whether meet the size equal to above-mentioned X size window.If above-mentioned X size window is when sweeping window Data in window are less than the size of X size window, record above-mentioned X size window on above-mentioned a parts of cutting datas Window end position is swept to be X stop place and/or sweep label X label at window end position in above-mentioned a parts of cutting datas.
For example, referring to fig. 4, Fig. 4 is an applied field provided by the embodiments of the present application for recording and sweeping window end position Scape schematic diagram.In application scenes, for a parts of cutting datas, it is assumed that the size of Y size window is W × W, Y window Mouthful step-length is W', to a part cutting datas progress from left to right, from top to bottom when sweeping window, when Y size window moves down one A Y window step length W' apart from when, the data (dash area) in above-mentioned Y size window are less than above-mentioned Y size window Size W × W of mouth records above-mentioned Y size window and sweeps window end position on above-mentioned a parts of cutting datas as W stop Position w.
104, a+1 parts of cutting datas after above-mentioned 1st part of cutting data are obtained, and are based on above-mentioned sliding window window information Indicated window since above-mentioned a parts of cutting datas sweep window end position to above-mentioned a+1 parts of cutting datas carry out Window is swept, each detected value for sweeping window region in above-mentioned a+1 parts of cutting datas is obtained, according to above-mentioned each detection for sweeping window region Value, which determines, above-mentioned each sweeps whether window region has face.
In some possible embodiments, a+1 parts of cutting datas after above-mentioned 1st part of cutting data are obtained, In, a is the integer greater than 0 and less than N.It is understood that when the size window of each size is in above-mentioned 1st part of cutting data In when all having recorded that each size window is corresponding to sweep window end position, obtain the 2nd part of cutting data.It is limited in hardware resource When, the above-mentioned 2nd part of cutting data of acquisition will cover all have been held by the size window of each size in above-mentioned 1st part of cutting data The data gone after once sweeping window operation.In other words, by the size window of each size in above-mentioned 1st part of cutting data The part data all crossed after once being swept window will be deleted.According to window indicated by above-mentioned sliding window window information from upper It states sweeping for the 1st part of cutting data to start that above-mentioned 2nd part of cutting data is carried out sweeping window at window end position, above-mentioned can be obtained Each detected value for sweeping window region in 2 parts of cutting datas.Specifically, if first size window is in above-mentioned 1st part of cutting data On window end position of sweeping be the first stop place, the second size window sweeps window stop bits on above-mentioned 1st part of cutting data It is set to the second stop place.Above-mentioned 2nd part of cutting data is obtained, it is above-mentioned according to moving every time using above-mentioned first size window The distance of first window step-length, from above-mentioned first stop place to above-mentioned 2nd part of cutting data carry out from left to right, from Top to bottm sweeps window, can obtain each inspection for sweeping window region that first size window is passed through in above-mentioned 1st part of cutting data Measured value.Using above-mentioned second size window, according to the distance for moving above-mentioned second window step length every time, from above-mentioned second stop place The place of setting start to above-mentioned 2nd part of cutting data carry out from left to right, from top to bottom sweep window, obtain above-mentioned 2nd part of cutting data In each detected value for sweeping window region for being passed through of the second size window.By comparing above-mentioned each detected value for sweeping window region with The size of preset value can determine and above-mentioned each sweep whether window region has face.If above-mentioned each sweep any in window region sweeps window The detected value in region is more than or equal to above-mentioned preset value, determines that there is face in any of the above-described window region of sweeping.At the same time, window is being swept The size window of each size is recorded in the process and sweeps window end position in above-mentioned 2nd part of cutting data, and record, which sweeps window, to be terminated The specific implementation of position is as described in step 103, and details are not described herein.Continue the 3rd part of cutting data of acquisition to be handled, directly The every part of cutting data in N part cutting data being cut into image to be detected data is completed sweeping for each size window Window then terminates to sweep window.
For example, show referring to the application scenarios that Fig. 5, Fig. 5 are method for detecting human face provided by the embodiments of the present application It is intended to.Assuming that getting the image that image to be detected is 720p, i.e. the image line width of image to be detected is 720, image to be detected Image col width be 1280, then the size of image to be detected data is represented by image line width × image col width, i.e., 720 × 1280.Wherein, the size of first size window is 300 × 300, and first window step-length is 84, and the size of the second size window is 180 × 180, the second window step length is 60.After above-mentioned image to be detected data are cut, 6 parts of cutting datas are obtained, here It will be illustrated using the 1st part of cutting data and the 2nd part of cutting data as example.Wherein, the 1st part of cutting data is mapping to be checked As the 0th~299 row of data, the 2nd part of cutting data is the 300th~383 row data in image to be detected data.Obtain the 1st Part cutting data (the 0th~299 row data) utilizes first size window since the starting point (the 0th row) of the 1st part of cutting data (300 × 300) carry out from left past above-mentioned 1st part of cutting data according to the distance of each mobile first window step-length 84 It is right, from top to bottom sweep window, first size window (300 × 300) sweeps sweeping window region and can obtaining an inspection for window process every time Obtain detected value d is compared by measured value with the size of preset value e.If detected value d is more than or equal to above-mentioned default Value e determines that there is face in the corresponding window region of sweeping detected value d.When first size window (300 × 300) is in above-mentioned 1st part of cutting number According to move down a first window step-length 84 apart from when, number of the above-mentioned first size window (300 × 300) when sweeping window in window According to (dash area in figure) be less than first size window (300 × 300) size, record above-mentioned first size window (300 × 300) the window end position of sweeping on above-mentioned 1st part of cutting data is the first stop place (the 84th row).Utilize the second size window Mouth (180 × 180) carries out from a left side above-mentioned 1st part of cutting data according to the distance of each mobile second window step length 60 Turn right, from top to bottom sweep window, the second size window (180 × 180) sweeps sweeping window region and can obtaining one for window process every time Obtain detected value c is compared by detected value with the size of preset value e.If detected value c is less than above-mentioned preset value e, really Fixed corresponding sweep in window region of above-mentioned detected value c does not have face.When the second size window (180 × 180) is cut at above-mentioned 1st part Moved down for the third time in data second window step length 60 apart from when, above-mentioned second size window (180 × 180) is when sweeping window Data (dash area in figure) in window record above-mentioned second size window less than the size of the second size window (180 × 180) The window end position of sweeping of mouth (180 × 180) on above-mentioned 1st part of cutting data is the second stop place (the 180th row).Obtain the 2 parts of cutting datas (the 300th~383 row data) are deleted in above-mentioned first part of cutting data by above-mentioned first size window (300 × 300) and above-mentioned second size window (180 × 180) all sweep the data (the 0th~83 row data) that window is crossed, and respectively from Start to continue above-mentioned 2nd part of data at above-mentioned first stop place (the 84th row) and above-mentioned second stop place (the 180th row) From left to right, from top to bottom sweep window, until every part of cutting data in 6 parts of cutting datas in above-mentioned image to be detected is all complete At window is swept, then sweeping window terminates, and sweeps window process as described above, details are not described herein.
In the embodiment of the present application, when getting image to be detected and needing to carry out Face datection to image to be detected, The N group cutting parameter in information is cut by the image of acquisition, is treated according to cutting mode indicated by above-mentioned N group cutting parameter Detection image data are cut, N part cutting data after available cutting.By obtaining above-mentioned N parts of cutting data every time In a cutting data, and utilize above-mentioned size window, according to it is each move a window step length distance, to every part above-mentioned Cutting data carries out sweeping window and recording and sweep window end position from left to right, from top to bottom, in available every part of cutting data Each detected value for sweeping window region that each size window is passed through, being compared by will test value and preset value, can be obtained To each Face datection result for sweeping window region.Made using the embodiment of the present application by being cut to large-size images data Every part of cutting data data volume reduction compared with whole image data after must cutting, and then the space of shared hardware resource also subtracts Few, then every part of cutting data after processing cutting several times is, it can be achieved that large-size images in the insufficient situation of hardware resource Face datection is carried out, the occupancy to hardware resource is reduced, improves hardware resource utilization, flexibility is high, strong applicability.
It is the structural schematic diagram of human face detection device provided by the embodiments of the present application referring to Fig. 6, Fig. 6.The embodiment of the present application The human face detection device of offer includes:
Information acquisition unit 31, for obtaining image processing data, above-mentioned image processing data includes sliding window window information Information is cut with image;
Data cutter unit 32, the above-mentioned image cutting information for being determined according to above- mentioned information acquiring unit 31 is to be checked Altimetric image data are cut, N part cutting data after being cut;
Cutting data processing unit 33, for obtaining in the above-mentioned N parts of cutting datas that above-mentioned data cutter unit 32 determines The 1st part of cutting data, and opened based on window indicated by above-mentioned sliding window window information from the starting point of above-mentioned 1st part of cutting data Beginning carries out sweeping window, obtains each detected value for sweeping window region in above-mentioned 1st part of cutting data, according to above-mentioned each window region of sweeping Detected value, which determines, above-mentioned each sweeps whether window region has face;
Above-mentioned cutting data processing unit 33 is also used to obtain above-mentioned 1st part that above-mentioned data cutter unit 32 determines and cuts A+1 parts of cutting datas after data are cut, and are cut based on window indicated by above-mentioned sliding window window information from above-mentioned a parts Sweeping for data starts to carry out sweeping window to above-mentioned a+1 parts of cutting datas at window end position, obtains above-mentioned a+1 parts of cutting datas In each detected value for sweeping window region, determined according to above-mentioned each detected value for sweeping window region and above-mentioned each sweep whether window region has Face, wherein a is the integer greater than 0 and less than N.
It in some possible embodiments, include N group cutting parameter in above-mentioned image cutting information, wherein i-th group is cut Cut the cutting mode that parameter is used to indicate i-th part of cutting data;Above-mentioned data cutter unit 32 is used for:
Obtain image to be detected data;
According to cutting mode indicated by each group cutting parameter in above-mentioned N group cutting parameter to above-mentioned image to be detected number According to image data cutting is carried out, N parts of cutting datas are obtained.
In some possible embodiments, above-mentioned sliding window window information includes window size and window step length, above-mentioned window Mouth size includes multiple sizes, wherein the corresponding size window of a size, the corresponding window step of a size window It is long;Above-mentioned human face detection device further include:
Cutting parameter determination unit 34, for obtaining the full-size in the corresponding multiple size windows of above-mentioned multiple sizes Window, using above-mentioned full-size window as first size window, wherein first size window corresponds to first window step-length;
The 1st group of cutting parameter is determined according to the image col width of above-mentioned first size window and above-mentioned image to be detected;
It is determined according to the image col width of above-mentioned first window step-length and above-mentioned image to be detected and removes above-mentioned 1st group of cutting parameter Except other N-1 group cutting parameters to obtain above-mentioned N group cutting parameter.
In some possible embodiments, above-mentioned sliding window window information includes window size and window step length, wherein on Window size is stated including at least first size and the second size, above-mentioned first size corresponds to first size window, above-mentioned second ruler Very little the second size window of correspondence, above-mentioned first size window correspond to first window step-length, above-mentioned second size window corresponding second Window step length;Above-mentioned cutting data processing unit 33 is used for:
It is cut according to the distance for moving above-mentioned first window step-length every time from above-mentioned 1st part using above-mentioned first size window Cut data starting point start carry out from left to right, from top to bottom sweep window, obtain first size window in above-mentioned 1st part of cutting data Each detected value for sweeping window region that mouth is passed through;
It is cut according to the distance for moving above-mentioned second window step length every time from above-mentioned 1st part using above-mentioned second size window Cut data starting point start carry out from left to right, from top to bottom sweep window, obtain the second size window in above-mentioned 1st part of cutting data Each detected value for sweeping window region that mouth is passed through;
By each detected value for sweeping window region and above-mentioned that first size window is passed through in above-mentioned 1st part of cutting data Each detected value for sweeping window region that the second size window is passed through in 1 part of cutting data is determined as above-mentioned 1st part of cutting data In each detected value for sweeping window region.
In some possible embodiments, above-mentioned human face detection device further include:
Stop place determination unit 35, for being swept on window to above-mentioned a parts of cutting datas when above-mentioned first size window When any data swept in window region and above-mentioned first size window are less than the size of above-mentioned first size window, above-mentioned the is recorded One size window sweep window to it is any of the above-described sweep window region when the first stop place on above-mentioned a parts of cutting datas;
When what above-mentioned second size window was swept on window to above-mentioned a parts of cutting datas any sweeps window region and above-mentioned second ruler When data in very little window are less than the size of above-mentioned second size window, record above-mentioned second size window and sweep window to any of the above-described The second stop place when sweeping window region on above-mentioned a parts of cutting datas;
The window of sweeping that above-mentioned first stop place and above-mentioned second stop place are determined as above-mentioned a parts of cutting datas is terminated Position.
In some possible embodiments, above-mentioned cutting data processing unit 33 is also used to:
Stopped according to the distance for moving above-mentioned first window step-length every time from above-mentioned first using above-mentioned first size window Stay start at position to above-mentioned a+1 parts of cutting datas carry out from left to right, from top to bottom sweep window, obtain above-mentioned a+1 parts Each detected value for sweeping window region that first size window is passed through in cutting data;
Stopped according to the distance for moving above-mentioned second window step length every time from above-mentioned second using above-mentioned second size window Stay start at position to above-mentioned a+1 parts of cutting datas carry out from left to right, from top to bottom sweep window, obtain above-mentioned a+1 parts Each detected value for sweeping window region that the second size window is passed through in cutting data;
By first size window is passed through in above-mentioned a+1 parts of cutting datas each detected value for sweeping window region and above-mentioned Each detected value for sweeping window region that the second size window is passed through in a+1 parts of cutting datas is determined as above-mentioned a+1 parts and cuts Cut each detected value for sweeping window region in data.
In some possible embodiments, above-mentioned cutting data processing unit 33 is also used to:
If the size of the more above-mentioned each detected value for sweeping window region and preset value each sweeps any in window region sweep above-mentioned The detected value in window region is more than or equal to above-mentioned preset value, determines that there is face in any of the above-described window region of sweeping.
In the specific implementation, above-mentioned human face detection device can be executed by each functional module built in it as in above-mentioned Fig. 1 Implementation provided by each step.For example, information acquisition unit 31, which can be used for executing in above-mentioned each step, obtains image Information and other implementations is handled, for details, reference can be made to implementations provided by above-mentioned each step, and details are not described herein.Above-mentioned number It can be used for executing according to cutter unit 32 and cut realization described in the correlation steps such as image to be detected data in above-mentioned each step Mode, for details, reference can be made to implementations provided by above-mentioned each step, and details are not described herein.Above-mentioned cutting data processing unit 33 can be used for executing in above-mentioned each step based on each size window and window step length to every part of cutting data sweep window with And determine whether face and other implementations, for details, reference can be made to implementations provided by above-mentioned each step, no longer superfluous herein It states.Above-mentioned cutting parameter determination unit 34, which can be used for executing, determines N group cutting parameter and other implementations in above-mentioned each step, tool Body can be found in implementation provided by above-mentioned each step, and details are not described herein.Above-mentioned stop place determination unit 35 can be used Each size window, which is recorded, in the above-mentioned each step of execution sweeps window end position and other implementations on every part of cutting data, For details, reference can be made to implementations provided by above-mentioned each step, and details are not described herein.
In the embodiment of the present application, human face detection device can be based in the image to be detected got and image cutting information N group cutting parameter, N part cutting data by being cut to image to be detected data, after available cutting.By every The secondary a cutting data obtained in above-mentioned N parts of cutting data, and above-mentioned size window is utilized, according to each mobile window The distance of step-length, to above-mentioned every part of cutting data carry out from left to right, from top to bottom sweep window and record sweep window end position, can To obtain each detected value for sweeping window region that each size window in every part of cutting data is passed through, by will test value and pre- If value is compared, each Face datection result for sweeping window region can be obtained.Using the embodiment of the present application, by large scale Image data is cut, so that the data volume compared with whole image data of every part of cutting data after cutting reduces, Jin Ersuo The space for accounting for hardware resource is also reduced, and then every part of cutting data after processing cutting several times is, it can be achieved that hardware resource is insufficient In the case where Face datection is carried out to large-size images, reduce to the occupancy of hardware resource, improve hardware resource utilization, Flexibility is high, applied widely.
It is the structural schematic diagram of terminal device provided by the embodiments of the present application referring to Fig. 7, Fig. 7.As shown in fig. 7, this implementation Terminal device in example may include: one or more processors 401 and memory 402.Above-mentioned processor 401 and memory 402 are connected by bus 403.For memory 402 for storing computer program, which includes program instruction, processing Device 401 is used to execute the program instruction of the storage of memory 402, performs the following operations:
Image processing data is obtained, above-mentioned image processing data includes sliding window window information and image cutting information;
It cuts information according to above-mentioned image to cut image to be detected data, N part cutting data after being cut;
The 1st part of cutting data in above-mentioned N parts of cutting data is obtained, and based on window indicated by above-mentioned sliding window window information It mouthful carries out sweeping window since the starting point of above-mentioned 1st part of cutting data, obtains each window region of sweeping in above-mentioned 1st part of cutting data Detected value determines according to above-mentioned each detected value for sweeping window region and above-mentioned each sweeps whether window region has face;
A+1 parts of cutting datas after above-mentioned 1st part of cutting data are obtained, and signified based on above-mentioned sliding window window information The window shown since above-mentioned a parts of cutting datas sweep window end position from above-mentioned a+1 parts of cutting datas are carried out sweeping window, Each detected value for sweeping window region in above-mentioned a+1 parts of cutting datas is obtained, it is true according to above-mentioned each detected value for sweeping window region It is fixed above-mentioned each to sweep whether window region has face, wherein a is greater than 0 and to be less than the integer of N.
It in some possible embodiments, include N group cutting parameter in above-mentioned image cutting information, wherein i-th group is cut Cut the cutting mode that parameter is used to indicate i-th part of cutting data;Above-mentioned processor 401 is used for:
Obtain image to be detected data;
According to cutting mode indicated by each group cutting parameter in above-mentioned N group cutting parameter to above-mentioned image to be detected number According to image data cutting is carried out, N parts of cutting datas are obtained.
In some possible embodiments, above-mentioned sliding window window information includes window size and window step length, above-mentioned window Mouth size includes multiple sizes, wherein the corresponding size window of a size, the corresponding window step of a size window It is long;Above-mentioned processor 401 is used for:
The full-size window in the corresponding multiple size windows of above-mentioned multiple sizes is obtained, by above-mentioned full-size window As first size window, wherein first size window corresponds to first window step-length;
The 1st group of cutting parameter is determined according to the image col width of above-mentioned first size window and above-mentioned image to be detected;
It is determined according to the image col width of above-mentioned first window step-length and above-mentioned image to be detected and removes above-mentioned 1st group of cutting parameter Except other N-1 group cutting parameters to obtain above-mentioned N group cutting parameter.
In some possible embodiments, above-mentioned sliding window window information includes window size and window step length, wherein on Window size is stated including at least first size and the second size, above-mentioned first size corresponds to first size window, above-mentioned second ruler Very little the second size window of correspondence, above-mentioned first size window correspond to first window step-length, above-mentioned second size window corresponding second Window step length;Above-mentioned processor 401 is used for:
It is cut according to the distance for moving above-mentioned first window step-length every time from above-mentioned 1st part using above-mentioned first size window Cut data starting point start carry out from left to right, from top to bottom sweep window, obtain first size window in above-mentioned 1st part of cutting data Each detected value for sweeping window region that mouth is passed through;
It is cut according to the distance for moving above-mentioned second window step length every time from above-mentioned 1st part using above-mentioned second size window Cut data starting point start carry out from left to right, from top to bottom sweep window, obtain the second size window in above-mentioned 1st part of cutting data Each detected value for sweeping window region that mouth is passed through;
By each detected value for sweeping window region and above-mentioned that first size window is passed through in above-mentioned 1st part of cutting data Each detected value for sweeping window region that the second size window is passed through in 1 part of cutting data is determined as above-mentioned 1st part of cutting data In each detected value for sweeping window region.
In some possible embodiments, above-mentioned processor 401 is used for:
When what above-mentioned first size window was swept on window to above-mentioned a parts of cutting datas any sweeps window region and above-mentioned first ruler When data in very little window are less than the size of above-mentioned first size window, record above-mentioned first size window and sweep window to any of the above-described The first stop place when sweeping window region on above-mentioned a parts of cutting datas;
When what above-mentioned second size window was swept on window to above-mentioned a parts of cutting datas any sweeps window region and above-mentioned second ruler When data in very little window are less than the size of above-mentioned second size window, record above-mentioned second size window and sweep window to any of the above-described The second stop place when sweeping window region on above-mentioned a parts of cutting datas;
The window of sweeping that above-mentioned first stop place and above-mentioned second stop place are determined as above-mentioned a parts of cutting datas is terminated Position.
In some possible embodiments, above-mentioned processor 401 is used for:
Stopped according to the distance for moving above-mentioned first window step-length every time from above-mentioned first using above-mentioned first size window Stay start at position to above-mentioned a+1 parts of cutting datas carry out from left to right, from top to bottom sweep window, obtain above-mentioned a+1 parts Each detected value for sweeping window region that first size window is passed through in cutting data;
Stopped according to the distance for moving above-mentioned second window step length every time from above-mentioned second using above-mentioned second size window Stay start at position to above-mentioned a+1 parts of cutting datas carry out from left to right, from top to bottom sweep window, obtain above-mentioned a+1 parts Each detected value for sweeping window region that the second size window is passed through in cutting data;
By first size window is passed through in above-mentioned a+1 parts of cutting datas each detected value for sweeping window region and above-mentioned Each detected value for sweeping window region that the second size window is passed through in a+1 parts of cutting datas is determined as above-mentioned a+1 parts and cuts Cut each detected value for sweeping window region in data.
In some possible embodiments, above-mentioned processor 401 is used for:
If the size of the more above-mentioned each detected value for sweeping window region and preset value each sweeps any in window region sweep above-mentioned The detected value in window region is more than or equal to above-mentioned preset value, determines that there is face in any of the above-described window region of sweeping.
It should be appreciated that in some possible embodiments, above-mentioned processor 401 can be central processing unit (centralprocessingunit, CPU), the processor can also be other general processors, digital signal processor (digitalsignalprocessor, DSP), specific integrated circuit (applicationspecificintegratedcircu It, ASIC), ready-made programmable gate array (fieldprogrammablegatearray, FPGA) or other programmable logic Device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor or this at Reason device is also possible to any conventional processor etc..The memory 402 may include read-only memory and random access memory, And instruction and data is provided to processor 401.The a part of of memory 402 can also include non-volatile random access storage Device.For example, memory 402 can be with the information of storage device type.
In the specific implementation, above-mentioned terminal device can be executed by each functional module built in it as each in above-mentioned Fig. 1 Implementation provided by step, for details, reference can be made to implementations provided by above-mentioned each step, and details are not described herein.
In the embodiment of the present application, terminal device can be based on the N in the image to be detected got and image cutting information Group cutting parameter, N part cutting data by being cut to image to be detected data, after available cutting.By each A cutting data in above-mentioned N parts of cutting data is obtained, and utilizes above-mentioned size window, according to each mobile window step Long distance carries out sweeping window and recording and sweep window end position from left to right, from top to bottom to above-mentioned every part of cutting data, can be with Each detected value for sweeping window region that each size window in every part of cutting data is passed through is obtained, by will test value and preset Value is compared, and can obtain each Face datection result for sweeping window region.Using the embodiment of the present application, by large scale figure As data are cut, so that the data volume reduction with whole image data compared with of every part of cutting data after cutting, and then it is shared The space of hardware resource is also reduced, and then every part of cutting data after processing cutting several times is, it can be achieved that hardware resource is insufficient In the case of Face datection is carried out to large-size images, reduce to the occupancy of hardware resource, improve hardware resource utilization, spirit It is active high, it is applied widely.
The embodiment of the present application also provides a kind of computer readable storage medium, which has meter Calculation machine program, the computer program include program instruction, which realizes each step institute in Fig. 1 when being executed by processor The method for detecting human face of offer, for details, reference can be made to implementations provided by above-mentioned each step, and details are not described herein.
Above-mentioned computer readable storage medium can be the human face detection device or above-mentioned that aforementioned any embodiment provides The internal storage unit of terminal device, such as the hard disk or memory of electronic equipment.The computer readable storage medium is also possible to The plug-in type hard disk being equipped on the External memory equipment of the electronic equipment, such as the electronic equipment, intelligent memory card (smartmediacard, SMC), secure digital (securedigital, SD) card, flash card (flashcard) etc..Further Ground, the computer readable storage medium can also both include the internal storage unit of the electronic equipment or set including external storage It is standby.The computer readable storage medium is for storing other program sum numbers needed for the computer program and the electronic equipment According to.The computer readable storage medium can be also used for temporarily storing the data that has exported or will export.
Following claims and term " first " in specification and attached drawing, " second ", " third ", " the 4th " etc. It is to be not use to describe a particular order for distinguishing different objects.In addition, term " includes " and " having " and they are any Deformation, it is intended that cover and non-exclusive include.Such as contain the process, method, system, product of a series of steps or units Or equipment is not limited to listed step or unit, but optionally further comprising the step of not listing or unit, or can Selection of land further includes the other step or units intrinsic for these process, methods, product or equipment.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments It is contained at least one embodiment of the application.It is identical that each position in the description shows that the phrase might not be each meant Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and Implicitly understand, embodiment described herein can be combined with other embodiments.In present specification and appended Term "and/or" used in claims refers to any combination and institute of one or more of associated item listed It is possible that combining, and including these combinations.Those of ordinary skill in the art may be aware that in conjunction with reality disclosed herein Each exemplary unit and algorithm steps of example description are applied, can be come with the combination of electronic hardware, computer software or the two real It is existing, in order to clearly illustrate the interchangeability of hardware and software, generally described in the above description according to function Each exemplary composition and step.These functions are implemented in hardware or software actually, depending on the specific of technical solution Using and design constraint.Professional technician can realize each specific application using distinct methods described Function, but it is this realize it is not considered that exceed scope of the present application.
Method provided by the embodiments of the present application and relevant apparatus be referring to method flow diagram provided by the embodiments of the present application and/ Or structural schematic diagram is come what is described, can specifically be realized by computer program instructions the every of method flow diagram and/or structural schematic diagram The combination of process and/or box in one process and/or box and flowchart and/or the block diagram.These computer programs refer to Enable the processor that can provide general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices To generate a machine, so that generating use by the instruction that computer or the processor of other programmable data processing devices execute In the function that realization is specified in one or more flows of the flowchart and/or structural schematic diagram one box or multiple boxes Device.These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with specific In the computer-readable memory that mode works, so that it includes instruction that instruction stored in the computer readable memory, which generates, The manufacture of device, the command device are realized in one box of one or more flows of the flowchart and/or structural schematic diagram Or the function of being specified in multiple boxes.These computer program instructions can also be loaded into computer or the processing of other programmable datas In equipment, so that executing series of operation steps on a computer or other programmable device to generate computer implemented place Reason, so that instruction executed on a computer or other programmable device offer is for realizing in one process of flow chart or multiple The step of function of being specified in process and/or structural representation one box or multiple boxes.

Claims (10)

1. a kind of method of Face datection, which is characterized in that the described method includes:
Image processing data is obtained, described image processing information includes sliding window window information and image cutting information;
It cuts information according to described image to cut image to be detected data, N part cutting data after being cut;
Obtain the 1st part of cutting data in the N parts of cutting data, and based on window indicated by the sliding window window information from The starting point of the 1st part of cutting data starts to carry out sweeping window, obtains each detection for sweeping window region in the 1st part of cutting data Value determines according to each detected value for sweeping window region and described each sweeps whether window region has face;
A+1 parts of cutting datas after the 1st part of cutting data are obtained, and based on indicated by the sliding window window information Window since a parts of cutting datas sweep window end position from the a+1 parts of cutting datas are carried out sweeping window, obtain Each detected value for sweeping window region in the a+1 parts of cutting datas determines institute according to each detected value for sweeping window region It states and each sweeps whether window region has face, wherein a is greater than 0 and to be less than the integer of N.
2. method according to claim 1, which is characterized in that it includes N group cutting parameter in information that described image, which is cut, In, i-th group of cutting parameter is used to indicate the cutting mode of i-th part of cutting data;It is described to be treated according to described image cutting information Detection image data are cut, N part cutting data after being cut, comprising:
Obtain image to be detected data;
According to cutting mode indicated by each group cutting parameter in the N group cutting parameter to image to be detected data into The cutting of row image data, obtains N parts of cutting datas.
3. method according to claim 2, which is characterized in that the sliding window window information includes window size and window step Long, the window size includes multiple sizes, wherein the corresponding size window of a size, a size window corresponding one A window step length;
The method also includes:
Obtain the full-size window in the corresponding multiple size windows of the multiple size, using the full-size window as First size window, wherein first size window corresponds to first window step-length;
The 1st group of cutting parameter is determined according to the image col width of the first size window and described image to be detected;
It is determined in addition to the 1st group of cutting parameter according to the image col width of the first window step-length and described image to be detected Other N-1 group cutting parameters to obtain the N group cutting parameter.
4. any one of -2 the methods according to claim 1, which is characterized in that the sliding window window information include window size and Window step length, wherein the window size includes at least first size and the second size, and the first size corresponds to first size Window, corresponding second size window of second size, the first size window correspond to first window step-length, second ruler Corresponding second window step length of very little window;
It is described to be swept since the starting point of the 1st part of cutting data based on window indicated by the sliding window window information Window obtains each detected value for sweeping window region in the 1st part of cutting data, comprising:
Using the first size window, according to the distance for moving the first window step-length every time, from the 1st part of cutting number According to starting point start carry out from left to right, from top to bottom sweep window, obtain first size window institute in the 1st part of cutting data The each detected value for sweeping window region passed through;
Using second size window, according to the distance for moving second window step length every time, from the 1st part of cutting number According to starting point start carry out from left to right, from top to bottom sweep window, obtain the second size window institute in the 1st part of cutting data The each detected value for sweeping window region passed through;
By first size window is passed through in the 1st part of cutting data each detected value for sweeping window region and 1st part described Each detected value for sweeping window region that the second size window is passed through in cutting data is determined as in the 1st part of cutting data respectively A detected value for sweeping window region.
5. method according to claim 4, which is characterized in that the method also includes:
When what the first size window was swept on window to a parts of cutting datas any sweeps window region and the first size window When data in mouthful are less than the size of the first size window, record the first size window and sweep window and any sweep window to described The first stop place when region on a parts of cutting datas;
When what second size window was swept on window to a parts of cutting datas any sweeps window region and the second size window When data in mouthful are less than the size of second size window, record second size window and sweep window and any sweep window to described The second stop place when region on a parts of cutting datas;
Window stop bits is swept by what first stop place and second stop place were determined as a parts of cutting datas It sets.
6. method according to claim 5, which is characterized in that it is described based on window indicated by the sliding window window information from Sweeping for a parts of cutting datas starts to carry out sweeping window to the a+1 parts of cutting datas at window end position, obtains described Each detected value for sweeping window region in a+1 parts of cutting datas, comprising:
Using the first size window, according to the distance for moving the first window step-length every time, from first stop place The place of setting start to the a+1 parts of cutting datas carry out from left to right, from top to bottom sweep window, obtain it is described a+1 part cut Each detected value for sweeping window region that first size window is passed through in data;
Using second size window, according to the distance for moving second window step length every time, from second stop place The place of setting start to the a+1 parts of cutting datas carry out from left to right, from top to bottom sweep window, obtain it is described a+1 part cut Each detected value for sweeping window region that the second size window is passed through in data;
The each detected value for sweeping window region and the a+ that first size window in the a+1 parts of cutting datas is passed through Each detected value for sweeping window region that the second size window is passed through in 1 part of cutting data is determined as the a+1 parts of cuttings number Each detected value for sweeping window region in.
7. any one of -6 the method according to claim 1, which is characterized in that described according to each detection for sweeping window region Value, which determines, described each sweeps whether window region has face, comprising:
Compare the size of each detected value for sweeping window region and preset value, each sweeps any area Sao Chuan in window region if described The detected value in domain is more than or equal to the preset value, determines that there is face in any window region of sweeping.
8. a kind of device of Face datection, which is characterized in that described device includes:
Information acquisition unit, for obtaining image processing data, it includes sliding window window information and image that described image, which handles information, Cut information;
Data cutter unit, the described image cutting information for being determined according to the information acquisition unit is to image to be detected number According to being cut, N part cutting data after being cut;
Cutting data processing unit is cut for obtaining the 1st part in the N parts of cutting datas that the data cutter unit determines Data are cut, and are swept since the starting point of the 1st part of cutting data based on window indicated by the sliding window window information Window obtains each detected value for sweeping window region in the 1st part of cutting data, true according to each detected value for sweeping window region It is fixed described each to sweep whether window region has face;
The cutting data processing unit, be also used to obtain the 1st part of cutting data that the data cutter unit determines it A+1 parts of cutting datas afterwards, and based on window sweeping from a parts of cutting datas indicated by the sliding window window information Start that the a+1 parts of cutting datas are carried out sweeping window at window end position, obtains each in the a+1 parts of cutting datas sweep The detected value in window region, according to each detected value for sweeping window region determine it is described it is each sweep whether window region has face, In, a is the integer greater than 0 and less than N.
9. a kind of terminal device, which is characterized in that including processor and memory, the processor and memory are connected with each other;
The memory is for storing computer program, and the computer program includes program instruction, and the processor is configured For calling described program to instruct, the method according to claim 1 to 7 is executed.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey Sequence, the computer program include program instruction, and described program instruction executes the processor such as The described in any item methods of claim 1-7.
CN201811541438.5A 2018-12-17 2018-12-17 Face detection method and device Active CN109657603B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811541438.5A CN109657603B (en) 2018-12-17 2018-12-17 Face detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811541438.5A CN109657603B (en) 2018-12-17 2018-12-17 Face detection method and device

Publications (2)

Publication Number Publication Date
CN109657603A true CN109657603A (en) 2019-04-19
CN109657603B CN109657603B (en) 2021-05-11

Family

ID=66113795

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811541438.5A Active CN109657603B (en) 2018-12-17 2018-12-17 Face detection method and device

Country Status (1)

Country Link
CN (1) CN109657603B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1889667A (en) * 2006-07-26 2007-01-03 浙江大学 Video frequency signal multi-processor parallel processing method
CN101271515A (en) * 2007-03-21 2008-09-24 株式会社理光 Image detection device capable of recognizing multi-angle objective
CN103049733A (en) * 2011-10-11 2013-04-17 株式会社理光 Human face detection method and human face detection equipment
CN105095866A (en) * 2015-07-17 2015-11-25 重庆邮电大学 Rapid behavior identification method and system
CN105338236A (en) * 2014-07-25 2016-02-17 诺基亚技术有限公司 Method and apparatus for detecting object in image and electronic device
CN106991363A (en) * 2016-01-21 2017-07-28 北京三星通信技术研究有限公司 A kind of method and apparatus of Face datection
CN108090908A (en) * 2017-12-07 2018-05-29 深圳云天励飞技术有限公司 Image partition method, device, terminal and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1889667A (en) * 2006-07-26 2007-01-03 浙江大学 Video frequency signal multi-processor parallel processing method
CN101271515A (en) * 2007-03-21 2008-09-24 株式会社理光 Image detection device capable of recognizing multi-angle objective
CN103049733A (en) * 2011-10-11 2013-04-17 株式会社理光 Human face detection method and human face detection equipment
CN105338236A (en) * 2014-07-25 2016-02-17 诺基亚技术有限公司 Method and apparatus for detecting object in image and electronic device
CN105095866A (en) * 2015-07-17 2015-11-25 重庆邮电大学 Rapid behavior identification method and system
CN106991363A (en) * 2016-01-21 2017-07-28 北京三星通信技术研究有限公司 A kind of method and apparatus of Face datection
CN108090908A (en) * 2017-12-07 2018-05-29 深圳云天励飞技术有限公司 Image partition method, device, terminal and storage medium

Also Published As

Publication number Publication date
CN109657603B (en) 2021-05-11

Similar Documents

Publication Publication Date Title
CN109978756A (en) Object detection method, system, device, storage medium and computer equipment
CN109543549B (en) Image data processing method and device for multi-person posture estimation, mobile terminal equipment and server
US11354797B2 (en) Method, device, and system for testing an image
US6628819B1 (en) Estimation of 3-dimensional shape from image sequence
CN104517265B (en) Intelligent grinding skin method and apparatus
CN103460705B (en) The real-time deep utilizing stereoscopic correspondence extracts
CN106155454A (en) A kind of interface display method, device and electronic equipment
CN107657051A (en) A kind of generation method of picture tag, terminal device and storage medium
CN109191508A (en) A kind of simulation beauty device, simulation lift face method and apparatus
CN108564579A (en) A kind of distress in concrete detection method and detection device based on temporal and spatial correlations
CN110136054A (en) Image processing method and device
US20230360256A1 (en) Contextual instance decoupling-based multi-person pose estimation method and apparatus
CN110490839A (en) The method, apparatus and computer equipment of failure area in a kind of detection highway
CN109036522A (en) Image processing method, device, equipment and readable storage medium storing program for executing
CN109635021A (en) A kind of data information input method, device and equipment based on human testing
CN107888970A (en) Method for processing video frequency, device, embedded device and storage medium
CN106331879A (en) Screen comment display method and device based on panoramic video
CN108573218A (en) Human face data acquisition method and terminal device
CN103593869A (en) Scanning equipment and image display method thereof
CN113610958A (en) 3D image construction method and device based on style migration and terminal
CN108509241A (en) A kind of full screen display process of image, full screen display device and mobile terminal
CN108509828A (en) A kind of face identification method and face identification device
CN108124157A (en) Information interacting method, apparatus and system
CN107833229A (en) Information processing method, apparatus and system
CN109657603A (en) The method and device of Face datection

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