CN102436578B - Formation method for dog face characteristic detector as well as dog face detection method and device - Google Patents

Formation method for dog face characteristic detector as well as dog face detection method and device Download PDF

Info

Publication number
CN102436578B
CN102436578B CN201210012738.0A CN201210012738A CN102436578B CN 102436578 B CN102436578 B CN 102436578B CN 201210012738 A CN201210012738 A CN 201210012738A CN 102436578 B CN102436578 B CN 102436578B
Authority
CN
China
Prior art keywords
dog
nostril
image
detected
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210012738.0A
Other languages
Chinese (zh)
Other versions
CN102436578A (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.)
Konfoong Biotech International Co Ltd
Original Assignee
Konfoong Biotech International 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 Konfoong Biotech International Co Ltd filed Critical Konfoong Biotech International Co Ltd
Priority to CN201210012738.0A priority Critical patent/CN102436578B/en
Publication of CN102436578A publication Critical patent/CN102436578A/en
Application granted granted Critical
Publication of CN102436578B publication Critical patent/CN102436578B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a formation method for a dog face characteristic detector as well as a dog face detection method and device. The formation method for a dog face characteristic detector comprises the following steps of: extracting a first preset quantity of dog face characteristic images; extracting a second present quantity of images which do not contain the dog face characteristic, wherein the second preset quantity is bigger than the first preset quantity; taking the dog face characteristic images as a positive sample of an Adaboost method; and taking the images which do not contain the dog face characteristic as the negative sample of the Adaboost method to obtain the dog face characteristic detector. The dog face characteristic detector formed by the technical scheme has good performance and can quickly and accurately detect the dog face characteristic. With the dog face detection method disclosed by the technical scheme of the invention, the position on which the dog face is positioned can be accurately detected, and the dog face detection method has high accuracy and good instantaneity when being used for detecting the dog face.

Description

Formation method, dog face detecting method and the device of dog face property detector
Technical field
The present invention relates to area of pattern recognition, relate in particular to a kind of formation method, dog face detecting method and device of dog face property detector.
Background technology
Target detection, also makes target extract, and is that the image of how much of a kind of based targets and statistical nature is cut apart, by target cut apart and identification unites two into one.In complex scene, conventionally need to process in real time multiple targets, therefore, the particular importance that just seems is extracted and identified to target automatically.Along with developing rapidly of computer vision technique, it is widely used in object detection field, for now, in prior art, there is the multiple method detecting for specific objective, as: face detection, pedestrian detection, vehicle detection etc., and from the development of target detection, the research aspect face detection, pedestrian detection, vehicle detection is also extensive, and little in the research of dog face context of detection.
As everyone knows, dog is mankind Achates, at present, in China, the U.S., Japan and other countries, the people who supports dog increases gradually, and therefore, the image processing techniques relevant to dog has market outlook widely, especially dog face recognition technology, has played vital effect at aspects such as dog registration, dog authentication, the making of dog photograph album and public safety monitoring.
It is a very important link in the identification of dog face that dog face detects, and it also belongs to the detection to specific objective, and the object that dog face detects detects dog face exactly from image background, in other words conj.or perhaps the subwindow of dog face and the subwindow of non-dog face is separated.For face detects, dog face detects wants the many of difficulty, this be mainly because: dog face changes various at the aspect such as shape, size, hair color, attitude, expression; Dog ears and face become mildewed and easily block its face, especially eyes part; In the time taking dog, because it is generally all in the state of walking about, need to capture, therefore cause the change in location of dog face in image, the position of dog face in image is always uncertain in other words very greatly, face is usually located at the center of image; The image difference that the factor such as change of background, illumination variation causes; Dog strains class is more, and dog sample image is difficult for gathering, and above-mentioned reason has caused existing object detection method directly effectively not detect dog face, and therefore, how can correctly detect dog face becomes one of current problem demanding prompt solution.
About the technology of target detection can be CN101799875A referring to publication number, the Chinese patent application that denomination of invention is a kind of object detection method, but for the problems referred to above, it does not relate to.
Summary of the invention
The problem that the present invention solves is how to detect accurately dog face.
For addressing the above problem, the invention provides a kind of formation method of dog face property detector, comprise the steps:
Extract the dog face characteristic image of the first predetermined quantity;
Extract the image of not comprising of the second predetermined quantity of described dog face feature; Described the second predetermined quantity is greater than described the first predetermined quantity;
Positive sample using described dog face characteristic image as Adaboost method, the described image that does not comprise described dog face feature obtains described dog face property detector as the negative sample of Adaboost method.
Optionally, extracting dog face characteristic image comprises:
From training image, extract the image that comprises dog face feature;
The described image that comprises dog face feature is normalized, obtains dog face characteristic image.
Optionally, described from training image extract comprise dog face feature image comprise:
Demarcate the upper left corner and position/upper right corner, the lower right corner and the position, the lower left corner of dog face feature in described training image;
The center of dog face feature in training image described in the upper left corner based on described dog face feature and position/upper right corner, the lower right corner and lower left corner position acquisition;
Take the center of described dog face feature as symcenter, the upper left corner of mobile described dog face feature and position/upper right corner, the lower right corner and position, the lower left corner are until the upper left corner of described dog face feature and the lower right corner/upper right corner and lower left corner distance in the horizontal direction and described dog face feature wide identical is identical with the height of described dog face feature in the distance of vertical direction.
Optionally, described from training image extract comprise dog face feature image comprise:
The rectangular window that foundation comprises described dog face feature;
Adjust size and the position of described rectangular window, until the edge of the rectangular window after adjusting and described dog face feature is circumscribed.
Optionally, described the described image that comprises dog face feature be normalized and comprised:
Normalization size based on predetermined and described in comprise dog face feature the size of image obtain convergent-divergent multiple;
Based on described convergent-divergent multiple, the described image that comprises dog face feature is carried out to interpolation.
Optionally, in the time that the described image that comprises dog face feature is coloured image, the gray level image of the described image that comprises dog face feature is normalized.
Optionally, the formation method of described dog face property detector, also comprises: the image that comprises dog face feature after normalization is carried out to left and right upset.
Optionally, describedly the image that comprises dog face feature after normalization carried out to left and right upset obtain in the following way:
P 1 ( i , j ) = P ( i , n c - j + 1 ) 1 ≤ i ≤ n r 1 ≤ j ≤ n c
Wherein, P (i, n c-j+1) be the capable n of i in the image that comprises dog face feature after normalization cthe pixel value of-j+1 row, P 1(i, j) is the pixel value of the capable j row of i in the image after the upset of left and right, n r× n cit is the size of the image that comprises dog face feature after normalization.
Optionally, the described positive sample using described dog face characteristic image as Adaboost method, the described image that does not comprise described dog face feature obtains described dog face property detector as the negative sample of Adaboost method and comprises:
Training parameter in described Adaboost method is set, and described training parameter comprises: positive sample number, negative sample number, positive/negative sample normalization size, progression, the minimum positive sample percent of pass of every one-level and the maximum false alarm rate of every one-level;
Obtain described dog face property detector based on described training parameter, described positive sample, negative sample.
Optionally, described dog face is characterized as dog nostril, and described dog face property detector is dog nostril detecting device, and the training parameter in described Adaboost method is:
Described positive sample number is more than or equal to 500;
Described negative sample number is described positive sample number 1.5~5 times;
After described positive/negative sample normalization, be of a size of 20 × 20~28 × 28 pixels;
Described progression is 15~25 grades;
The minimum positive sample percent of pass of described every one-level is 0.995~0.998;
The maximum false alarm rate of described every one-level is 0.46~0.50.
Optionally, described dog face is characterized as dog eyes, and described dog face property detector is dog eye detector, and the training parameter in described Adaboost method is:
Described positive sample number is more than or equal to 400;
Described negative sample number is described positive sample number 2~4 times;
Described positive/negative sample normalization is of a size of 10 × 15~20 × 30 pixels;
Described progression is 15~25 grades;
The minimum positive sample percent of pass of described every one-level is 0.995~0.998;
The maximum false alarm rate of described every one-level is 0.46~0.50.
For addressing the above problem, the present invention also provides a kind of dog face detecting method, comprising:
Treat detected image and carry out pre-service;
Adopt the dog face property detector of above-mentioned acquisition to detect the dog face feature in pretreated image to be detected;
Testing result by described dog face property detector is demarcated described dog face.
Optionally, described in, treating detected image carries out pre-service and comprises:
Based on segmentation zoom factor, described image to be detected is carried out to convergent-divergent, described segmentation zoom factor is associated with the size of dog face property detector;
To the image rotation predetermined angular to be detected after convergent-divergent.
Optionally, described in, treating detected image carries out pre-service and also comprises:
Described image to be detected is being carried out after convergent-divergent, before the image rotation predetermined angular to be detected after convergent-divergent, the image to be detected after described convergent-divergent is being carried out to left and right upset.
Optionally, the dog face property detector of the above-mentioned acquisition of described employing detects and comprises the dog face feature in pretreated image to be detected:
According to the size of current search window, pretreated Image Segmentation Using to be detected is obtained at least one search subwindow;
Detect described search subwindow by described dog face property detector, until the search subwindow that has described dog face feature detected;
If do not exist, upgrade the size of current search window with preset multiple, repeat said process, until the size of current search window is greater than the size of pretreated image to be detected;
There is the position of the search subwindow of described dog face feature in output.
Optionally, described dog face is characterized as dog nostril, and described dog face property detector is dog nostril detecting device, and the described testing result by described dog face property detector is demarcated and comprised by following formula and demarcate described dog face described dog face:
x f 1 = x c 1 - 1.25 × ( x c 2 - x c 1 ) y f 1 = y c 1 - 2.5 × ( y c 2 - y c 1 ) x f 2 = x c 2 + 1.25 × ( x c 2 - x c 1 ) y f 2 = y c 2 + 0.5 × ( y c 2 - y c 1 )
Wherein, (x c1, y c1) and (x c2, y c2) be respectively the upper left corner, dog nostril that detects and the position in the lower right corner, (x f1, y f1) and (x f2, y f2) be respectively the dog face upper left corner of demarcation and the position in the lower right corner.
Optionally, described dog face is characterized as dog eyes, and described dog face property detector is dog eye detector, and the described testing result by described dog face property detector is demarcated and comprised by following formula and demarcate described dog face described dog face:
x f 1 = x a 1 - 0.5 × ( x a 2 - x a 1 ) y f 1 = min ( y a 1 , y b 1 ) - 0.5 × ( y a 2 - y a 1 ) x f 2 = x b 2 + 0.5 × ( x b 2 - x b 1 ) y f 2 = max ( y a 2 , y b 2 ) + 0.5 × ( y b 2 - y b 1 )
Wherein, (x a1, y a1) and (x a2, y a2) be respectively the left eye eyeball upper left corner of the dog detecting and the position in the lower right corner, (x b1, y b1) and (x b2, y b2) be respectively the right eye eyeball upper left corner of the dog detecting and the position in the lower right corner, (x f1, y f1) and (x f2, y f2) be respectively the dog face upper left corner of demarcation and the position in the lower right corner.
For addressing the above problem, the present invention also provides a kind of dog face pick-up unit, comprising:
The dog face property detector of above-mentioned acquisition;
Pretreatment unit, is suitable for treating detected image and carries out pre-service;
Detecting unit, is suitable for adopting described dog face property detector to detect the dog face feature in pretreated image to be detected;
Demarcate unit, the testing result being suitable for based on described detecting unit is demarcated described dog face.
For addressing the above problem, the present invention also provides a kind of dog face detecting method, comprising:
Treat detected image and carry out pre-service;
Adopt the dog nostril detecting device of above-mentioned acquisition to detect the dog nostril in pretreated image to be detected;
The dog eyes that adopt the dog eye detector of above-mentioned acquisition to treat in detected image detect;
Testing result by described dog nostril detecting device and described dog eye detector is demarcated described dog face.
Optionally, described in, treating detected image carries out pre-service and comprises:
Based on segmentation zoom factor, described image to be detected is carried out to convergent-divergent, described segmentation zoom factor is associated with the size of dog nostril detecting device;
To the image rotation predetermined angular to be detected after convergent-divergent.
Optionally, described in, treating detected image carries out pre-service and also comprises:
Described image to be detected is being carried out after convergent-divergent, before the image rotation predetermined angular to be detected after convergent-divergent, the image to be detected after convergent-divergent is being carried out to left and right upset.
Optionally, the dog nostril detecting device of the above-mentioned acquisition of described employing detects and comprises the dog nostril in pretreated image to be detected:
According to the size of current search window, pretreated Image Segmentation Using to be detected is obtained at least one search subwindow;
Detect described search subwindow by described dog nostril detecting device, until the search subwindow that has described dog nostril detected;
If do not exist, upgrade the size of current search window with preset multiple, repeat said process, until the size of current search window is greater than the size of pretreated image to be detected;
There is the position of the search subwindow in described dog nostril in output.
Optionally, the dog eye detector of the above-mentioned acquisition of described employing is treated dog eyes in detected image and is detected and comprise:
Treat detected image according to the size of current search window and cut apart at least one search subwindow of acquisition;
Detect described search subwindow by described dog eye detector, until the search subwindow that has described dog eyes detected;
If do not exist, upgrade the size of current search window with preset multiple, repeat said process, until the size of current search window is greater than the size of image to be detected;
There is the position of the search subwindow of described dog eyes in output.
Optionally, the described testing result by described dog nostril detecting device and described dog eye detector is demarcated and is comprised described dog face:
When dog nostril and two dog eyes being detected, and dog nostril do not overlap with two dog eyes, by following formula, described dog face demarcated:
x a = 0.5 × ( x a 2 + x a 1 ) y a = 0.5 × ( y a 2 + y a 1 ) x b = 0.5 × ( x b 2 + x b 1 ) y b = 0.5 × ( y b 2 + y b 1 ) x c = 0.5 × ( x c 2 + x c 1 ) y c = 0.5 × ( y c 2 + y c 1 )
x f 1 = x a - 0.5 × ( x b - x a ) y f 1 = min ( y a , y b ) - 0.25 × ( y c - min ( y a , y b ) ) x f 2 = x b + 0.5 × ( x b - x a ) y f 2 = y c + 0.5 × ( y c - min ( y a , y b ) )
Wherein, (x a, y a) be the center of the left eye eyeball of calibrated dog, (x b, y b) be the center of the right eye eyeball of calibrated dog, (x c, y c) be the center in calibrated dog nostril, (x a1, y a1) and (x a2, y a2) be respectively the left eye eyeball upper left corner of the dog detecting and the position in the lower right corner, (x b1, y b1) and (x b2, y b2) be respectively the right eye eyeball upper left corner of the dog detecting and the position in the lower right corner, (x c1, y c1) and (x c2, y c2) be respectively the upper left corner, dog nostril that detects and the position in the lower right corner, (x f1, y f1) and (x f2, y f2) be respectively the dog face upper left corner of demarcation and the position in the lower right corner.
Optionally, the described testing result by described dog nostril detecting device and described dog eye detector is demarcated and is comprised described dog face:
When detecting that dog nostril and dog eyes and described dog nostril do not overlap with dog eyes; Or dog nostril only detected, by following formula, described dog face demarcated:
x f 1 = x c 1 - 1.25 × ( x c 2 - x c 1 ) y f 1 = y c 1 - 2.5 × ( y c 2 - y c 1 ) x f 2 = x c 2 + 1.25 × ( x c 2 - x c 1 ) y f 2 = y c 2 + 0.5 × ( y c 2 - y c 1 )
Wherein, (x c1, y c1) and (x c2, y c2) be respectively the upper left corner, dog nostril that detects and the position in the lower right corner, (x f1, y f1) and (x f2, y f2) be respectively the dog face upper left corner of demarcation and the position in the lower right corner.
Optionally, the described testing result by described dog nostril detecting device and described dog eye detector is demarcated and is comprised described dog face:
When dog nostril and two dog eyes being detected, and described dog nostril overlaps with dog eyes, by following formula, described dog face demarcated:
x f 1 = x a 1 - 0.5 × ( x a 2 - x a 1 ) y f 1 = min ( y a 1 , y b 1 ) - 0.5 × ( y a 2 - y a 1 ) x f 2 = x b 2 + 0.5 × ( x b 2 - x b 1 ) y f 2 = max ( y a 2 , y b 2 ) + 0.5 × ( y b 2 - y b 1 )
Wherein, (x a1, y a1) and (x a2, y a2) be respectively the left eye eyeball upper left corner of the dog detecting and the position in the lower right corner, (x b1, y b1) and (x b2, y b2) be respectively the right eye eyeball upper left corner of the dog detecting and the position in the lower right corner, (x f1, y f1) and (x f2, y f2) be respectively the dog face upper left corner of demarcation and the position in the lower right corner.
For addressing the above problem, the present invention also provides a kind of dog face pick-up unit, comprising:
The dog nostril detecting device of above-mentioned acquisition;
The dog eye detector of above-mentioned acquisition;
Pretreatment unit, is suitable for treating detected image and carries out pre-service;
Dog nostril detecting unit, is suitable for adopting described dog nostril detecting device to detect the dog nostril in pretreated image to be detected;
Dog eye detection unit, the dog eyes that are suitable for adopting described dog eye detector to treat in detected image detect;
Demarcate unit, be suitable for based on the testing result of described dog nostril detecting unit and described dog eye detection unit, described dog face being demarcated.
Compared with prior art, technical scheme of the present invention has the following advantages:
By the positive sample using dog face characteristic image as Adaboost method, do not comprise the image of described dog face feature as the negative sample of Adaboost method, and then train the performance of the dog face property detector obtaining good by Adaboost method, can detect accurately and rapidly the feature of dog face.
By adopting above-mentioned dog face property detector to detect the dog face in pretreated image to be detected, can detect exactly the position at dog face place, and accuracy when described dog face is detected is high, real-time good.
Further, described pre-service comprises that treating detected image carries out rotating predetermined angular after segmentation convergent-divergent again, while making to adopt described dog face property detector to detect dog face, can detect the poor image to be detected of picture quality, and when treating detected image and carrying out adopting again described dog face property detector to detect dog face after above-mentioned pre-service, can also accelerate the detection speed to thering is high-resolution image to be detected, and then realize the dog face in different images to be detected is detected fast and accurately.
Further, by dog nostril detecting device, the dog nostril in pretreated image to be detected is detected, the dog eyes for the treatment of in detected image by dog eye detector detect, realize take dog nostril and having detected as main, dog eye detection is auxiliary dog face to be detected, due in testing process take dog nostril as main, dog eyes are auxiliary, therefore can remove the detection false-alarm that may hit the nostril of the dog on dog eyes, and then can be more accurate, realize rapidly the detection to dog face, and take the testing result of dog nostril detecting device as main, the testing result of dog eye detector is auxiliary dog face to be detected, real-time is good, the accuracy detecting is high, false alarm rate is very low.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of the formation method of the dog face property detector of embodiment of the present invention;
Fig. 2 is the process flow diagram of the formation method of the dog nostril detecting device of the embodiment of the present invention one;
Fig. 3 is the schematic diagram of the extraction dog nostril image of the embodiment of the present invention one;
Fig. 4 is the process flow diagram of the formation method of the dog eye detector of the embodiment of the present invention two;
Fig. 5 is the process flow diagram of the dog face detecting method of the embodiment of the present invention three;
Fig. 6 treats detected image to carry out pretreated process flow diagram in the embodiment of the present invention three;
Fig. 7 is the location diagram of dog nostril and dog eyes in dog face model;
Fig. 8 is the actual example figure after adopting the dog face detecting method of the embodiment of the present invention three to treat detected image to detect;
Fig. 9 is the structural representation of the dog face pick-up unit of the embodiment of the present invention three;
Figure 10 is the process flow diagram of the dog face detecting method of the embodiment of the present invention four;
Figure 11 is the structural representation of the dog face pick-up unit of the embodiment of the present invention four.
Embodiment
As what describe in background technology, almost blank for dog face context of detection in prior art, and dog face detects for face detects more difficult.
Inventor finds by research, with respect to other pets as: for cat, rabbit etc., the differentiation in the nostril of dog is relatively good, though this be because the kind of dog how, most dog all has circular nostril, be that dog nostril is more stable on shape and structure, and for general dog, dog nostril is conventionally large than dog eyes, and dog nostril is not subject to blocking of its face's hair color, the impact that changed by angle is little, good to the robustness of angle.And for dog eyes, in the situation that not blocking, it is also relatively stable on shape and structure.
Therefore, inventor proposes to form dog face property detector by the mode of off-line training, described dog face feature can be dog nostril, dog eyes, dog face, for the different characteristic of dog face is detected accordingly, in the present invention particularly, form dog nostril detecting device dog nostril is detected, form dog eye detector dog eyes are detected.
Dog face property detector based on obtaining in off-line training process, and then utilize described dog face property detector to detect dog face in the online process detecting, demarcate the position at dog face place.Particularly, by the online dog nostril of detecting in image to be detected of dog nostril detecting device, and then demarcate by the Dui Goulian position, position in the dog nostril that detects; Or by the online dog eyes that detect in image to be detected of dog eye detector, and then demarcate by the Dui Goulian position, position of the dog eyes that detect; Or not only detected the dog nostril in image to be detected but also detected the dog eyes in image to be detected by dog eye detector by dog nostril detecting device, and then the position in the dog nostril detecting take dog nostril detecting device is as main, the position of the dog eyes that dog eye detector detects is auxiliary, treat the position of the dog face in detected image and demarcate, to realize the accurate detection to dog face.
Refer to Fig. 1, Fig. 1 is the process flow diagram of the formation method of the dog face property detector of embodiment of the present invention, and as shown in Figure 1, the formation method of described dog face property detector comprises:
Step S1: the dog face characteristic image that extracts the first predetermined quantity.
Step S2: the image that does not comprise described dog face feature that extracts the second predetermined quantity; Described the second predetermined quantity is greater than described the first predetermined quantity.
Step S3: the positive sample using described dog face characteristic image as Adaboost method, the described image that does not comprise described dog face feature obtains described dog face property detector as the negative sample of Adaboost method.
For the formation method of dog face property detector of embodiment of the present invention is described better, below in conjunction with the formation method of dog nostril detecting device and the formation method of dog eye detector, the formation method of the dog face property detector to embodiment of the present invention is described in detail.
Embodiment mono-
Refer to Fig. 2, Fig. 2 is the process flow diagram of the formation method of the dog nostril detecting device of the embodiment of the present invention one, and as shown in Figure 2, the formation method of described dog nostril detecting device comprises:
Step S1a: the dog nostril image that extracts the first predetermined quantity.
Step S2a: extract the image that does not comprise described dog nostril of the second predetermined quantity, described the second predetermined quantity is greater than described the first predetermined quantity.
Step S3a: the positive sample using described dog nostril image as Adaboost method, the described image that does not comprise described dog nostril obtains described dog nostril detecting device as the negative sample of Adaboost method.
Execution step S1a, in order to extract the dog nostril image of the first predetermined quantity, the image that comprises dog that need to first gather some (is called the image that comprises dog gathering training dog image conventionally, the image in the dog nostril of extracting is called dog nostril image for training), in the present embodiment, particularly, can pass through image capture device, as camera, the picture that video camera or on the net search include dog gathers training dog image, in order to improve the performance of dog nostril detecting device, it is many that the training gathering should be tried one's best with the number of dog image, the training gathering can be both that coloured image can be also black white image with dog image.
In the present embodiment, the training collecting can be identical with described the first predetermined quantity by the quantity of dog image, also can be slightly less than described the first predetermined quantity (this situation is applicable to a width training dog image and comprises the training of the image of at least two dogs dog image), preferably, the training collecting is identical with described the first predetermined quantity by the quantity of dog image, described the first predetermined quantity N 1be more than or equal to 500 width, and in order to extract clear and complete dog nostril image, for each the width training dog image collecting, should comprise the front of the dog face of a dog as far as possible, or the approximate front of the dog face of a dog, can be completely clearly visible with the nostril of guaranteeing dog.
In the present embodiment, in order the nostril of most of dog to be detected, the wide W in dog nostril in dog image for the training collecting nshould be more than or equal to 22 pixels, the high H in dog nostril nshould be more than or equal to 22 pixels, the size in dog nostril should meet:
W n ≥ 22 H n ≥ 22
Further, if consider, training is too large by the size in the dog nostril in dog image, probably causing the dog nostril detecting device of follow-up acquisition to treat the nostril of doggie in detected image can't detect, if and undersized with the dog nostril in dog image of training, may cause the dog nostril detecting device of follow-up acquisition to treat dog nostril in detected image while detecting, differentiate the nostril of unclear dog and cause undetected or flase drop.Therefore,, in the present embodiment, the training collecting is preferably by the size in dog nostril in dog image:
22 ≤ W n ≤ 26 22 ≤ H n ≤ 26
The training that utilization collects is extracted dog nostril image with dog image, comprises particularly:
, with extracting the image that comprises dog nostril dog image the described image that comprises dog nostril is normalized from training, obtains dog nostril image.
In the present embodiment, can be undertaken by following two kinds of modes with extracting the image that comprises dog nostril dog image from training, below illustrate one by one.
The first:
Demarcate the upper left corner and lower right corner position/upper right corner and the lower left corner position of described training with dog nostril in dog image.
Described in the upper left corner based on described dog nostril and position/upper right corner, the lower right corner and lower left corner position acquisition, the center in dog nostril in dog image is used in training.
Take the center in described dog nostril as symcenter, the upper left corner in mobile described dog nostril and position/upper right corner, the lower right corner and position, the lower left corner are until the upper left corner in described dog nostril and the lower right corner/upper right corner and lower left corner distance in the horizontal direction and described dog nostril wide identical is identical with the height in described dog nostril in the distance of vertical direction.
In the present embodiment, describe as example with the upper left corner in dog nostril in dog image and position, the lower right corner to demarcate described training.Refer to Fig. 3, Fig. 3 is the schematic diagram of the extraction dog nostril image of the embodiment of the present invention one, and as shown in Figure 3, the position, the upper left corner of demarcating dog nostril is initial position (x n1, y n1), position, the lower right corner is final position (x n2, y n2), in order to obtain the image in complete dog nostril, need to guarantee should comprise completely take the line between described initial position and described final position as cornerwise rectangle dog nostril.After demarcating in the upper left corner to dog nostril and position, the lower right corner, the center in dog nostril can obtain by following formula:
x n = x n 2 + x n 1 2 , y n = y n 2 + y n 1 2 ,
Then, take the center in described dog nostril as symcenter, position, the upper left corner and the position, the lower right corner in mobile described dog nostril.
Particularly, set the wide W between initial position (position, the upper left corner in dog nostril) and final position (position, the lower right corner in dog nostril) 1=x n2~x n1, the high H between initial position and final position 1=y n1-y n2, the horizontal coordinate x of maintenance final position n2constant, vertically Mobile Termination position, the ordinate y of maintenance initial position n1constant, along continuous straight runs moves initial position, then adjusts the position of initial position and final position as symcenter take center, until W 1wide identical with dog nostril, H 1identical with the height in dog nostril, can extract dog nostril image.
Above-mentioned only take demarcate initial position as the upper left corner in dog nostril, final position is as the lower right corner in dog nostril as example is illustrated, can also demarcate in other embodiments the upper right corner that initial position is dog nostril, dog nostril image is extracted in the lower left corner that final position is dog nostril, concrete leaching process is similar as the process of extraction dog nostril, the lower right corner image in dog nostril with the upper left corner, final position take initial position as dog nostril, no longer launches to describe in detail herein.
The second:
The rectangular window that foundation comprises described dog nostril.
Adjust size and the position of described rectangular window, until the edge in the rectangular window after adjusting and described dog nostril is circumscribed.
Particularly, in training, with setting up the rectangular window that comprises dog nostril in dog image, the length breadth ratio of the rectangular window preferentially set up is identical with the ratio of width to height in described dog nostril, dwindles the size of rectangular window until the edge in the four edges of rectangular window and dog nostril is circumscribed.
Generally, it is circular that dog nostril is approximately, therefore, the ratio approximately equal of the height in the wide and dog nostril in dog nostril, conventionally the scope of the ratio of width to height in dog nostril is 0.9~1.1, in reality detects, for the ease of gathering dog nostril image for training, conventionally in the time that the image in dog nostril is extracted, extract the image in dog nostril take the ratio of width to height in dog nostril as 1.
In addition, in the present embodiment, if the training collecting is coloured image with dog image, the dog nostril image extracting is also coloured image, now need to be converted into gray level image, particularly, by following formula, the coloured image in dog nostril be converted to the gray level image in dog nostril:
P=0.299×R+0.587×G+0.114×B
Wherein, P is the gray-scale value of pixel arbitrarily in the gray level image in dog nostril after conversion, and R, G, B are respectively the component values of this pixel corresponding red, green and blue primary colours in the coloured image in dog nostril.
By above-mentioned steps from training with having extracted dog image after the image that comprises dog nostril, also need the image that comprises dog nostril to extracting to be normalized, obtain corresponding convergent-divergent multiple by the size that comprises dog nostril image and the predetermined normalization size extracted, based on described convergent-divergent multiple and image difference method, the image that comprises dog nostril extracting is carried out to interpolation, and then realize the normalization to described dog nostril image.
In the present embodiment, the size of the dog nostril image after normalization can be between 20 × 20~28 × 28 pixels, below are of a size of 24 × 24 pixels with the dog nostril image after normalization, and the normalization process of described dog nostril image is carried out to brief description.
Obtain the convergent-divergent multiple RN of dog nostril image according to the physical size that comprises dog nostril image of extracting and the final normalized size of needs 1, described convergent-divergent multiple RN 1specifically obtain by following formula:
RN 1 = W nn W in W nn = 24 Or RN 1 = H nn H in H nn = 24
Wherein, W infor dog nostril image wide of extracting, H infor the height of dog nostril image extracting, W nnwide for the dog nostril image after normalization, H nnfor the height of the dog nostril image after normalization.
The convergent-divergent multiple RN of the dog nostril image based on obtaining 1with corresponding image interpolation method, the image in dog nostril is normalized, described image interpolation method can adopt bilinear interpolation (bilinearinterpolation), arest neighbors interpolation (nearest neighbor interpolation), bicubic interpolation (bicubicinterpolation) etc., in the present embodiment, preferably adopt bilinear interpolation method or arest neighbors interpolation method to be normalized the dog nostril image extracting.Adopt the convergent-divergent multiple of image interpolation method and image to be normalized the known technology into this area to image, therefore, concrete detailed description in detail no longer launched herein.
After the image in described dog nostril is normalized, in order to obtain more sample number, to improve the performance of dog nostril detecting device of follow-up acquisition, can carry out left and right upset to the dog nostril image after the normalization obtaining and obtain dog nostril image for new training, therefore for above-mentioned extraction the first predetermined quantity N 1the image in dog nostril, overturn by left and right, can obtain 2N 1dog nostril image.
Particularly, by following formula, dog nostril image is carried out to left and right upset:
P 1 ( i , j ) = P ( i , n c - j + 1 ) 1 ≤ i ≤ n r 1 ≤ j ≤ n c
Wherein, P (i, n c-j+1) be the capable n of i in the dog nostril image after normalization cthe pixel value of-j+1 row, P 1(i, j) is the pixel value of the capable j row of i in the dog nostril image after the upset of left and right, n r× n cit is the size of the dog nostril image after normalization.In the present embodiment, be of a size of 24 × 24 pixels with the dog nostril image after normalization and describe, therefore n r=24, n c=24.
So far, by said method from the training collecting with having extracted the image that comprises dog nostril dog image, obtained the training of following adopted Adaboost training method and obtained the positive sample of dog nostril detecting device.
Execution step S2a: extract the image that does not comprise described dog nostril of the second predetermined quantity, in this step, both can never comprise the image that extracts non-dog nostril in the image of dog, also can extract non-dog nostril image from the image that comprises dog.The described image that does not comprise the image of dog or comprise dog can pass through camera, camera acquisition or the method by internet searching and obtain.
In order to improve the performance of dog nostril detecting device, especially improve the differentiation performance of the dog nostril detecting device pair target similar to described dog nostril, in the present embodiment, preferably, never comprise the image that extracts non-dog nostril in image for training of dog, and the described training that does not comprise dog for example, with comprising as far as possible various common backgrounds and other more targets: cat, rabbit, deer, tiger, lion, pedestrian and icon etc. in image.And the quantity of the image that does not comprise dog nostril collecting can be identical with the second predetermined quantity, also can be less than described the second predetermined quantity, for latter event, be by extracting several images that do not comprise dog nostril to obtain the image that does not comprise dog nostril of the second predetermined quantity in every piece image.
Dog nostril image after the size and the normalization that do not comprise dog nostril image of extracting in the present embodiment measure-alike.Extract and do not comprise the common practise that the image in dog nostril is this area, therefore, no longer launch to repeat herein.
In addition, it should be noted that, if the training of extracting is also coloured image with the image that does not comprise dog nostril, still need to convert thereof into as gray level image, particularly, the formula adopting can be converted to the gray level image in dog nostril referring to the above-mentioned coloured image by dog nostril time repeats no more herein.
In the present embodiment, described the second predetermined quantity N 2be greater than described the first predetermined quantity N 1, preferably, described the second predetermined quantity N 2at 1.5 N 1~5 N 1between.
So far, obtained the negative sample of following adopted Adaboost training method training acquisition dog nostril detecting device by step S2a.
Execution step S3a: utilize the training dog nostril image obtaining in step S1a as the positive sample in Adaboost method, the training obtaining in step S2a as the negative sample in Adaboost method, trains to obtain dog nostril detecting device with the image that does not comprise dog nostril.Adopt the common practise that Adaboost method training detecting device is this area, no longer launch to repeat herein.In the present embodiment, the training parameter in Adaboost method comprises: positive sample number, negative sample number, positive/negative sample normalization size, progression, the minimum positive sample percent of pass of every one-level and the maximum false alarm rate of every one-level.
Described positive sample number, the number of dog nostril image for the training that is said extracted, by above-mentioned can know dog nostril image is carried out can making the number of dog nostril image double after the upset of left and right, be 2N so locate the number of positive sample 1, described negative sample number, the training use that is above-mentioned extraction does not comprise the number of dog nostril image; Described progression is the included multistage number of Adaboost detecting device, and for every one-level, it all has corresponding detection performance index.The positive sample percent of pass of every one-level refers to for every one-level, the positive sample number correctly detecting accounts for the number percent of total positive sample number, for instance, the dog nostril image extracting is 100 width, the dog nostril detecting device that training at the corresponding levels obtains detects that 60 width are dog nostril image, and the positive sample percent of pass of this grade is 60%; Every one-level false alarm rate refers to for every one-level, error-detecting to negative sample number account for the number percent of total positive sample number, for instance, extract the image that 100 width comprise dog nostril, it is the images that do not comprise dog nostril that but the dog nostril detecting device that training at the corresponding levels obtains is tested with 20 width, and the false alarm rate of this grade is 20%.In order to obtain preferably dog nostril detecting device of performance, in the time that training parameter is arranged, the percent of pass of the positive sample of minimum of every one-level should be high as much as possible, and the maximum false alarm rate of every one-level should be low as much as possible.
In the present embodiment, for the better performances of the dog nostril detecting device that can make finally to obtain, need to arrange accordingly the training parameter in Adaboost method, particularly, positive sample number is more than or equal to 500, i.e. training is greater than with the number of dog nostril image or equals 500 width (training of actual acquisition dog image can only be more than or equal to 250 width, in the training that is more than or equal to 250 width with extracting the image that comprises dog nostril that is more than or equal to 250 width in dog image, carry out again the final training number of dog nostril image that obtains of left and right upset and be more than or equal to 500 width), negative sample number is 1.5~5 times of described positive sample number, i.e. training is 1.5~5 times by dog nostril picture number of training with the number that does not comprise dog nostril image, positive/negative sample normalization is of a size of 20 × 20~28 × 28 pixels, training is 15~25 grades with progression, the minimum positive sample percent of pass of every one-level is 0.995~0.998, the maximum false alarm rate of every one-level is 0.46~0.50.In the present embodiment, preferably, while adopting Adaboost method training dog nostril detecting device, the concrete setting of correlation parameter refers to table 1.
Table 1
Positive sample number 1564 Progression 19
Negative sample number 3000 The minimum positive sample percent of pass of every one-level 0.998
Normalization size 24×24 The maximum false alarm rate of every one-level 0.48
So far, obtained dog nostril detecting device by above-mentioned step S1a, S2a, S3a.
Embodiment bis-
Refer to Fig. 4, Fig. 4 is the process flow diagram of the formation method of the dog eye detector of the embodiment of the present invention two, and as shown in Figure 4, the formation method of described dog eye detector comprises:
Step S1b: a dog eye image that extracts the first predetermined quantity.
Step S2b: extract the image that does not comprise described dog eyes of the second predetermined quantity, described the second predetermined quantity is greater than described the first predetermined quantity.
Step S3b: the positive sample using described dog eye image as Adaboost method, the described image that does not comprise described dog eyes obtains described dog eye detector as the negative sample of Adaboost method.
In the present embodiment, in step S1b, extract a dog eye image of the first predetermined quantity, similar with the process of dog nostril image of extracting the first predetermined quantity in embodiment mono-, different is with dog image from training, the image that extraction comprises dog eyes, so the image of locating extracting dog eyes no longer launches concrete detailed description, only carries out simple explanation.
In the present embodiment, for the extraction of a dog eye image, described the first predetermined quantity N 1(training of actual acquisition dog image can be more than or equal to 100 width to be more than or equal to 400 width, gather training with extracting the left eye of dog and/or the eye image of dog in dog image, the left-eye image of the dog of extracting is carried out to left and right upset, and about the eye image of the dog of extracting is carried out, upset can be extracted the image of dog eyes that are more than or equal to 400 width).
Consider when following adopted dog eye detector detects dog eyes, dog eyes can be detected as far as possible accurately, therefore in the training collecting use dog image, the wide W of arbitrary dog eyes eshould meet and be more than or equal to 15 pixels, the high H of arbitrary dog eyes eshould meet and be more than or equal to 10 pixels, the size of arbitrary dog eyes should meet:
W e ≥ 15 H e ≥ 10
Further, if consider, training is too large by the size of the dog eyes in dog image, probably cause eye detection that the dog eye detector of follow-up acquisition treats doggie in detected image less than, if and undersized with the dog eyes in dog image of training, may cause the dog eye detector of follow-up acquisition to treat dog eyes in detected image detecting time, differentiate the eyes of unclear dog and cause undetected or flase drop.Therefore,, in the present embodiment, the training collecting is preferably by the size of arbitrary dog eyes in dog image:
13 ≤ W e ≤ 17 8 ≤ H e ≤ 12
The training that utilization collects is extracted a dog eye image with dog image, comprises particularly:
, with extracting the image that comprises dog eyes dog image the described image that comprises dog eyes is normalized from training, obtains a dog eye image.In the present embodiment, similar by the process from training the image that comprises dog nostril with extraction dog image extracted dog image in a dog eye image and embodiment mono-from training, also can adopt two kinds of modes as described in as a kind of in embodiment to carry out.
When extraction, as long as by collect training with the upper left corner/upper right corner of dog eyes that meets size in dog image be demarcated as initial position, the lower right corner/lower left corner is demarcated as final position, then determine the center of dog eyes according to calibrated initial position and final position, and then take described center as symcenter moves described initial position and final position, until distance in the horizontal direction of described initial position and final position and described dog eyes is wide identical, identical with the height of described dog eyes in the distance of vertical direction.
Adopt the second way from training when extracting dog eyes dog image, particularly, the rectangular window that comprises dog eyes with foundation in dog image in training, the length breadth ratio of the rectangular window preferably set up is identical with the ratio of width to height of dog eyes, dwindles the size of rectangular window until the edge of the four edges of rectangular window and dog eyes is circumscribed.
Generally, the scope of the ratio of width to height of dog eyes is 1.3~1.7, in reality detects, use dog eye image for the ease of gathering training, conventionally in the time of the image extraction to dog eyes, take the ratio of width to height of dog eyes as 1.5 images that extract dog eyes.
It should be noted that, in the present embodiment, if the training of extracting is coloured image with dog eye image, also need to be converted into gray level image, dog eyes coloured image is converted to the formula that gray level image can be converted to gray level image referring to the dog nostril coloured image in embodiment mono-to carry out.
Extracting after the image of dog eyes, also need the image of dog eyes to be normalized, in the present embodiment, the size of the dog eyes after normalization can be between 10 × 15~20 × 30 pixels, image to described dog eyes is normalized, also be to obtain corresponding convergent-divergent multiple by the size that comprises dog eye image and the predetermined normalization size of extraction, based on described convergent-divergent multiple and image interpolation method, the dog eye image extracting is carried out to interpolation, and then realize the normalization to described dog eye image.
After the image of described dog eyes is normalized, still can carries out left and right upset by the dog eye image to after normalization and obtain more training dog eye image, and then improve the performance of the dog eye detector of follow-up acquisition.Therefore for above-mentioned extraction the first predetermined quantity N 1the image of dog eyes, overturn by left and right, can obtain 2N 1dog eye image.
Training after normalization is carried out to left and right upset with dog eye image can be carried out referring to the formula that in embodiment mono-, dog nostril image is carried out overturning left and right, if in the present embodiment, the dog eye image after normalization is of a size of 10 × 15, n in above-mentioned formula r=10, n c=15.
In the present embodiment, in step S2b, extract that in the image that does not comprise described dog eyes of the second predetermined quantity and embodiment mono-, to extract the image that does not comprise described dog nostril of the second predetermined quantity similar, dog eye image measure-alike after the size and the normalization that do not comprise dog eye image of extracting, and described the second predetermined quantity N 2be greater than described the first predetermined quantity N 1, preferably, described the second predetermined quantity N 2at 2N 1~4N 1between.
In the present embodiment, positive sample in step S3b in using the training dog eye image that obtains in step S1b as Adaboost method, the training obtaining in step S2b uses the image that does not comprise described dog eyes as the negative sample in Adaboost method, adopting in Adaboost method training dog eye detector and embodiment mono-adopts Adaboost method training dog nostril detecting device similar, arranging of different is in training process training parameter is different, in the present embodiment, for the better performances of the dog eye detector that can make finally to obtain, the arranging of training parameter of being correlated with while adopting Adaboost method to train dog eye detector is as follows: positive sample number is more than or equal to 400, i.e. training is greater than with the number of dog eye image or equals 400 width, negative sample number is 2~4 times of described positive sample number, i.e. training is 2~4 times of training dog eye image quantity by the quantity that does not comprise dog eye image, positive/negative sample normalization is of a size of 10 × 15~20 × 30 pixels, training is 15~25 grades with progression, the minimum positive sample percent of pass of every one-level is 0.995~0.998, the maximum false alarm rate of every one-level is 0.46~0.50.In the present embodiment, preferably, while adopting Adaboost method training dog eye detector, the concrete setting of correlation parameter refers to table 2.
Table 2
Positive sample number 600 Progression 20
Negative sample number 1500 The minimum positive sample percent of pass of every one-level 0.996
Normalization size 10×15 The maximum false alarm rate of every one-level 0.48
So far, obtained dog eye detector by above-mentioned step S1b, S2b, S3b.
Obtain after dog nostril detecting device and dog eye detector by said method, can pass through these two kinds of dog face property detectors, treating dog nostril in detected image and the position at dog eyes place detects, and then demarcate the position of dog face by the position at the dog nostril that detects and dog eyes place, detect dog face.In order to describe the dog face detecting method of the embodiment of the present invention in detail, below respectively detecting dog face by dog nostril detecting device, dog eye detector detects dog face and by the mode of dog nostril detecting device and dog eye detector joint-detection dog face, the dog face detecting method of the embodiment of the present invention is illustrated accordingly.
Embodiment tri-
In the present embodiment, be the dog nostril that detects take dog nostril detecting device as main, the dog eyes that dog eye detector detects are auxiliary dog face to be detected.
Refer to Fig. 5, Fig. 5 is the process flow diagram of the dog face detecting method of the embodiment of the present invention three, and as shown in Figure 5, described dog face detecting method comprises:
Step S4: treat detected image and carry out pre-service.
Step S5: adopt dog nostril detecting device to detect the dog nostril in pretreated image to be detected.
Step S6: the dog eyes that adopt dog eye detector to treat in detected image detect.
Step S7: the testing result by described dog nostril detecting device and described dog eye detector is demarcated described dog face.
Execution step S4, in order can to detect the dog face in different images to be detected, as detected in dog nostril less in the image to be detected to second-rate, also in order to accelerate the processing speed of high-resolution image to be detected, first treat detected image and carry out corresponding pre-service simultaneously.Refer to Fig. 6, Fig. 6 treats detected image to carry out pretreated process flow diagram in the embodiment of the present invention three, and as shown in Figure 6, described pre-service comprises:
Step S4a: based on segmentation zoom factor, described image to be detected is carried out to convergent-divergent, described segmentation zoom factor is associated with the size of dog nostril detecting device.
Step S4b: the image to be detected after convergent-divergent is carried out to left and right upset.
Step S4c: to the image rotation predetermined angular to be detected after convergent-divergent.
Execution step S4a, particularly, first structural segmentation convergent-divergent function, in the present embodiment, segmentation convergent-divergent function is specially:
f ( x ) = s 1 x ∈ ( 0 , a 1 ) · · · · · · s n x ∈ [ a n - 1 , a n ) · · · · · · s N - 1 x ∈ [ a N - 2 , a N - 1 ) s N = 1280 x x ∈ [ a N - 1 , + ∞ )
Wherein, N is total interval number, s nn interval corresponding convergent-divergent multiple, 1≤n≤N; The value of N and the Size dependence of image to be detected, in the present embodiment, N value is the positive integer between 3~15; X is size larger in the size of image to be detected, and particularly, if image to be detected is horizontal figure, what x was horizontal figure is wide, if image to be detected is perpendicular figure, x is the height of perpendicular figure.In the present embodiment, the division in convergent-divergent interval is in particular: a 1value between 50~100, a n-1value is between 800~3000, and other a nvalue can be chosen or by formula at random by increasing progressively:
Figure BDA0000131329080000252
2≤n≤N-2 carries out; The value of convergent-divergent multiple is specially: s 1value between 5~15, s n-1value is 1, s nvalue is other s nvalue can be chosen by successively decreasing or at random by formula:
Figure BDA0000131329080000254
2≤n≤N-2.
For image to be detected, if W is the wide of image to be detected, H is high, and establishing m is the parameter while choosing corresponding convergent-divergent multiple s, obtains m by following formula:
M=α × W+ β × H, wherein α >=0, β >=0, and alpha+beta=1
Then the independent variable of the piecewise function f using m as above-mentioned structure, now the x in piecewise function is m, belongs to the different multiple s that select to treat detected image when interval and should carry out convergent-divergent at m.
Obtain after the corresponding convergent-divergent multiple on different intervals by above-mentioned segmentation convergent-divergent function, treat detected image based on described convergent-divergent multiple combining image interpolation method and carry out corresponding convergent-divergent, to make the dog nostril in image to be detected can be detected accurately by described dog nostril detecting device.Described image interpolation method can adopt as: bilinear interpolation method, arest neighbors interpolation method, bicubic interpolation method etc., preferably adopt bilinear interpolation method or arest neighbors interpolation method in the present embodiment.
In the present embodiment, the corresponding convergent-divergent multiple of piecewise function of structure and the Size dependence of training the dog nostril detecting device obtaining, concrete, described convergent-divergent multiple is determined by the size of training dog nostril size in the image to be detected of adding up gained on the size of dog nostril detecting device of gained and each convergent-divergent interval.Inventor is by testing several images to be detected that collect, preferably segmentation convergent-divergent interval and the convergent-divergent multiple corresponding to described segmentation convergent-divergent interval are finally determined, in the present embodiment, the segmentation convergent-divergent interval of described segmentation is 12 intervals, particularly, be followed successively by (0, 100), [100, 150), [150, 200), [200, 250), [250, 300), [300, 350), [350, 400), [400, 450), [450, 500), [500, 800), [800, 1280) and [1280, + ∞), corresponding to corresponding interval, adopt above-mentioned segmentation convergent-divergent function, both can obtain convergent-divergent multiple corresponding on each interval is 6 successively, 5.5, 5, 4.5, 4, 3.5, 3, 2.5, 2, 1.5, 1,
Figure BDA0000131329080000261
In the present embodiment, accuracy while detection in order to improve further the dog face for the treatment of in detected image, preferably, to carry out left and right upset through pretreated image to be detected, the upset of described left and right is similar with the left and right upset in the formation method of dog nostril detecting device or the formation method of dog eye detector, therefore, no longer launch concrete detailed description in detail herein.
Due to not necessarily its front of the dog face in image to be detected, therefore dog nostril is also not necessarily positive, the accuracy while adopting dog nostril detecting device to detect dog nostril in order to improve, to the image rotation predetermined angle pretreated to be detected after the upset of left and right.And because dog nostril is circular, therefore its robustness that angle is changed is good, for dog nostril image pretreated to be detected to the right or to the left, can be by the image to be detected to after the upset of pre-service and left and right clockwise or be rotated counterclockwise predetermined angle α to make more approaching front, dog nostril, particularly, if dog nostril is to the right, α turns clockwise, if dog nostril is to the left, be rotated counterclockwise α, in the present embodiment the value of α at 5 degree between 10 degree.
Image to be detected has been carried out after above-mentioned pre-service, described image to be detected has been carried out after convergent-divergent, left and right upset, rotation, all perform step S5, adopt the dog nostril detecting device obtaining in embodiment mono-to detect the dog nostril in pretreated image to be detected.Particularly,
According to the size of current search window, pretreated Image Segmentation Using to be detected is obtained at least one search subwindow.
Detect described search subwindow by described dog nostril detecting device, until the search subwindow that has described dog nostril detected.
If do not exist, upgrade the size of current search window with preset multiple, repeat said process, until the size of current search window is greater than the size of pretreated image to be detected.
There is the position of the search subwindow in described dog nostril in output.
In the present embodiment, the Size dependence of described preset multiple and pretreated image to be detected, in general, described preset multiple is between 1.2~1.5, the original dimension of current search window and dog nostril detecting device measure-alike, be of a size of 24 × 24 pixels with above-mentioned dog nostril detecting device, described preset multiple is 1.2 for example, the original dimension that current search window is set is 24 × 24 pixels, according to the original dimension of current search window to pretreated Image Segmentation Using to be detected, obtain multiple search subwindows, adopt dog nostril detecting device to detect it to each search subwindow, as dog nostril detected, store the position of this search subwindow, and there is the position of the search subwindow in described dog nostril in output, detection of end.If dog nostril do not detected, the size of current search window being updated to 29 × 29 pixels (should be 28.8 × 28.8 according to preset multiple, detect for convenient, therefore the size of current search window after upgrading should be size to current search window and the product of preset multiple rounds), the size of the current search window based on after upgrading, continue pretreated Image Segmentation Using to be detected, search dog nostril, until the size of the current search window after final updated is greater than the size of pretreated image to be detected.
After adopting dog nostril detecting device to detect the dog nostril in pretreated image to be detected, the dog eyes that adopt dog eye detector to treat in detected image detect.Particularly, treat detected image according to the size of current search window and cut apart at least one search subwindow of acquisition.
Detect described search subwindow by described dog eye detector, until the search subwindow that has described dog eyes detected.
If do not exist, upgrade the size of current search window with preset multiple, repeat said process, until the size of current search window is greater than the size of image to be detected.
There is the position of the search subwindow of described dog eyes in output.
While adopting dog eye detector to detect the dog eyes in image to be detected, the Size dependence of described preset multiple and image to be detected, in general, described preset multiple is between 1.2~1.5, the original dimension of current search window and dog eye detector measure-alike, be of a size of 10 × 15 pixels with dog eye detector, preset multiple is 1.2 for example, the original dimension that current search window is set is 10 × 15 pixels, treating detected image according to the original dimension of current search window cuts apart, obtain multiple search subwindows, adopt dog eye detector to detect it to each search subwindow, as dog eyes detected, store the position of this search subwindow, and there is the position of the search subwindow of described dog eyes in output, detection of end.If dog eyes do not detected, the size of current search window is updated to 12 × 18 pixels, the size of the current search window based on after upgrading, continuing to treat detected image cuts apart, search dog eyes, until the size of the current search window after final updated is greater than the size of image to be detected.In addition, if in renewal process, the size of the current search window after renewal is not integer, while renewal again as current search window 12 × 18 pixels to above-mentioned, be 14.4 × 21.6, similarly, the size of the current search window after renewal should be size to current search window and the product of preset multiple rounds, therefore the size of the search window after current search window 12 × 18 pixels are upgraded should be 15 × 22.
Dog nostril and the dog eyes that can treat in detected image by above-mentioned dog nostril detecting device and dog eye detector detect, and then can demarcate dog face by the testing result of dog nostril and dog eyes.
Before dog face is demarcated, first the position relationship of dog nostril and dog eyes in dog face model is illustrated accordingly.Refer to Fig. 7, Fig. 7 is the location diagram of dog nostril and dog eyes in dog face model; As shown in Figure 7, in figure, A and B represent respectively the center of the left eye eyeball of dog and the right eye eyeball of dog, C represents the center in dog nostril, when behind the position, the upper left corner and lower right corner location positioning of dog left/right eyes, the center of dog left/right eyes can be determined, behind the position, the upper left corner and lower right corner location positioning in dog nostril, the center in dog nostril has also just been determined.Center by dog left eye eyeball and right eye eyeball or/and the center in dog nostril can demarcate dog face.
In this enforcement, adopt dog nostril detecting device and dog eye detector to carry out after joint-detection, just can demarcate dog face by the testing result of dog nostril detecting device and dog eye detector.Particularly, in testing process, may there is following testing result:
(1) dog nostril and two dog eyes detected, and dog nostril and two dog eyes do not overlap, the testing result of the testing result in dog nostril and dog eyes is correctly simultaneously; And then the dog face for the treatment of in detected image by following formula is demarcated:
x a = 0.5 × ( x a 2 + x a 1 ) y a = 0.5 × ( y a 2 + y a 1 ) x b = 0.5 × ( x b 2 + x b 1 ) y b = 0.5 × ( y b 2 + y b 1 ) x c = 0.5 × ( x c 2 + x c 1 ) y c = 0.5 × ( y c 2 + y c 1 )
x f 1 = x a - 0.5 × ( x b - x a ) y f 1 = min ( y a , y b ) - 0.25 × ( y c - min ( y a , y b ) ) x f 2 = x b + 0.5 × ( x b - x a ) y f 2 = y c + 0.5 × ( y c - min ( y a , y b ) )
Wherein, (x a, y a) be the center of the left eye eyeball of calibrated dog, (x b, y b) be the center of the right eye eyeball of calibrated dog, (x c, y c) be the center in calibrated dog nostril, (x a1, y a1) and (x a2, y a2) be respectively the left eye eyeball upper left corner of the dog detecting and the position in the lower right corner, (x b1, y b1) and (x b2, y b2) be respectively the right eye eyeball upper left corner of the dog detecting and the position in the lower right corner, (x c1, y c1) and (x c2, y c2) be respectively the upper left corner, dog nostril that detects and the position in the lower right corner, (x f1, y f1) and (x f2, y f2) be respectively the dog face upper left corner of demarcation and the position in the lower right corner.
(2) dog nostril and dog eyes detected, and described dog nostril and dog eyes do not overlap, the testing result in dog nostril is correct simultaneously, and the testing result of dog eyes is false-alarm; Or dog nostril only detected, by following formula, described dog face demarcated:
x f 1 = x c 1 - 1.25 × ( x c 2 - x c 1 ) y f 1 = y c 1 - 2.5 × ( y c 2 - y c 1 ) x f 2 = x c 2 + 1.25 × ( x c 2 - x c 1 ) y f 2 = y c 2 + 0.5 × ( y c 2 - y c 1 )
(3) dog nostril and two dog eyes detected, but dog nostril and dog eyes have coincidence, the testing result in dog nostril is false-alarm simultaneously, and the testing result of dog eyes is correct; By following formula, described dog face is demarcated:
x f 1 = x a 1 - 0.5 × ( x a 2 - x a 1 ) y f 1 = min ( y a 1 , y b 2 ) - 0.5 × ( y a 2 - y a 1 ) x f 2 = x b 2 + 0.5 × ( x b 2 - x b 1 ) y f 2 = max ( y a 2 , y b 2 ) + 0.5 × ( y b 2 - y b 1 )
(4) dog nostril and dog eyes detected, but dog nostril and dog eyes have coincidence, the testing result of dog nostril and dog eyes is false-alarm, cannot demarcate dog face simultaneously.
(5) one or two dog eyes only detected, the testing result of dog eyes is false-alarm, cannot demarcate dog face.
(6) do not detect whatever, show in image to be detected without dog.
It should be noted that, for above-mentioned testing process, if after the position in the dog nostril detecting by described dog nostril detecting device demarcates described dog face with the position of the dog eyes that detect by described dog eye detector, occur
x f 1 ≤ 0 y f 1 ≤ 0 x f 1 = 1 y f 1 = 1
x f 1 ≥ W y f 1 ≥ H x f 1 = W y f 1 = H
Wherein, W, H is respectively the wide and high of image to be detected.
Table 3 is the dog face detecting methods that adopt the present embodiment, the test result obtaining when image to be detected is detected:
Table 3
Dog total number of images (width) 565
Average resolution rate (pixel) 652×488
Dog strains class sum (kind) Be greater than 80
Dog face sum (individual) 708
Detect accuracy (%) 86.86%
Detect false alarm rate (individual/image) 0.152
Refer to Fig. 8, Fig. 8 is the actual example figure after adopting the dog face detecting method of the embodiment of the present invention three to treat detected image to detect; The rectangle frame of wherein demarcating on dog nostril is the result that dog nostril detecting device detects, the rectangle frame of demarcating on dog eyes is the result that dog eye detector detects, and maximum rectangle frame is the dog face testing result of demarcating according to the position relationship of the dog nostril detecting and dog eyes.In the process that dog face is demarcated, the testing result of dog eye detector has played booster action.Shown in example three dogs be different types of dog, image background is general life background, in figure, dog face is all accurately detected, two cats in middle example also can correctly be distinguished, overall testing result does not have false-alarm.For the image in the example of the right, dog eyes do not detect, but this does not affect take dog nostril as main, dog eyes are demarcated dog face as auxiliary.The test result of associative list 3 and Fig. 8 can learn, by the dog face detecting method of the present embodiment, can detect accurately dog face.
Corresponding to above-mentioned dog face detecting method, the embodiment of the present invention also provides a kind of dog face pick-up unit, refers to Fig. 9, and Fig. 9 is the structural representation of the dog face pick-up unit of the embodiment of the present invention three, and as shown in Figure 9, described dog face pick-up unit comprises:
Dog nostril detecting device 101.
Dog eye detector 102.
Pretreatment unit 103, is suitable for treating detected image and carries out pre-service.
Dog nostril detecting unit 104, is connected with described dog nostril detecting device 101, pretreatment unit 103, is suitable for adopting described dog nostril detecting device 101 to detect the dog nostril in pretreated image to be detected.
Dog eye detection unit 105, is connected with described dog eye detector 102, and the dog eyes that are suitable for adopting described dog eye detector 102 to treat in detected image detect.
Demarcate unit 106, be connected with described dog nostril detecting unit 104, dog eye detection unit 105, be suitable for based on the testing result of described dog nostril detecting unit 104 and described dog eye detection unit 105, described dog face being demarcated.
In the present embodiment, described pretreatment unit 103 comprises:
Segmentation unit for scaling (not shown), is suitable for, based on segmentation zoom factor, described image to be detected is carried out to convergent-divergent, and described segmentation zoom factor is associated with the size of described dog nostril detecting device.
Rotary unit (not shown), is suitable for the image rotation predetermined angular to be detected after convergent-divergent.
Left and right roll-over unit (not shown), be suitable at described segmentation unit for scaling, described image to be detected being carried out after convergent-divergent, before the image rotation predetermined angular to be detected of described rotary unit after to convergent-divergent, the image to be detected after described convergent-divergent is carried out to left and right upset.
Described dog nostril detecting unit 104 comprises:
The first cutting unit (not shown), is suitable for, according to the size of current search window, pretreated Image Segmentation Using to be detected is obtained at least one search subwindow.
The first detecting unit (not shown), is suitable for detecting described search subwindow by described dog nostril detecting device 101, until the search subwindow that has described dog nostril detected.
The first updating block (not shown), is suitable in the time that described the first detecting unit can't detect the search subwindow that has described dog nostril, upgrades the size of current search window with the first preset multiple.
The first control module (not shown), when being suitable for the size of current search window after described the first updating block upgrades and being less than or equal to the size of described pretreated image to be detected, controls said units work.
The first output unit (not shown), is suitable in the time that described the first detecting unit detects the search subwindow that has described dog nostril, and output exists the position of the search subwindow in described dog nostril.
Described dog eye detection unit 105 comprises:
The second cutting unit (not shown), is suitable for treating detected image according to the size of current search window and cuts apart at least one search subwindow of acquisition.
The second detecting unit (not shown), is suitable for detecting described search subwindow by described dog eye detector 102, until the search subwindow that has described dog eyes detected.
The second updating block (not shown), is suitable in the time that described the second detecting unit can't detect the search subwindow that has described dog eyes, upgrades the size of current search window with the second preset multiple.
The second control module (not shown), when being suitable for the size of current search window after described the second updating block upgrades and being less than or equal to the size of described image to be detected, controls said units work.
The second output unit (not shown), is suitable in the time that described the second detecting unit detects the search subwindow that has described dog eyes, and output exists the position of the search subwindow of described dog eyes.
In the present embodiment, the process that described dog face pick-up unit detects dog face can be carried out referring to above-mentioned dog face detecting method, repeats no more herein.
Embodiment tetra-
In the present embodiment, by adopting described dog nostril detecting device dog nostril to be detected or adopting described dog eye detector to detect that dog eyes detect dog face, adopt dog face property detector to detect dog face feature, and then by described dog face feature, dog face is demarcated.Below the method that adopts dog face property detector to detect dog face is illustrated accordingly.
Refer to Figure 10, Figure 10 is the process flow diagram of the dog face detecting method of the embodiment of the present invention four; As shown in figure 10, described dog face detecting method comprises:
Step S4 ': treat detected image and carry out pre-service.
Step S5 ': adopt dog face property detector to detect the dog face feature in pretreated image to be detected.
Step S6 ': the testing result by described dog face property detector is demarcated described dog face.
In the present embodiment, described dog face property detector can be both that dog nostril detecting device can be also dog eye detector, and in the present embodiment, treat detected image and carry out pre-service, and adopt dog nostril detecting device to detect the dog nostril in pretreated image to be detected and embodiment tri-in similar, adopt dog eye detector to detect with adopting dog nostril detecting device and detect similar to the dog nostril in pretreated image to be detected the dog eyes in pretreated image to be detected, the demarcation for the treatment of dog face in detected image also with embodiment tri-in similar, so locate no longer to launch concrete detailed description.
Corresponding to above-mentioned dog face detecting method, the embodiment of the present invention also provides a kind of dog face pick-up unit, refers to Figure 11, and Figure 11 is the structural representation of the dog face pick-up unit of the embodiment of the present invention four, and as shown in figure 11, described dog face pick-up unit comprises:
Dog face property detector 201.
Pretreatment unit 202, is suitable for treating detected image and carries out pre-service.
Detecting unit 203, is connected with described dog face property detector 201, pretreatment unit 202, is suitable for adopting described dog face property detector 201 to detect the dog face feature in pretreated image to be detected.
Demarcate unit 204, be connected with described detecting unit 203, the testing result being suitable for based on described detecting unit 203 is demarcated described dog face.
In the present embodiment, described pretreatment unit 202 comprises:
Segmentation unit for scaling (not shown), is suitable for, based on segmentation zoom factor, described image to be detected is carried out to convergent-divergent, and described segmentation zoom factor is associated with the size of dog face property detector.
Rotary unit (not shown), is suitable for the image rotation predetermined angular to be detected after convergent-divergent.
Left and right roll-over unit (not shown), be suitable at described segmentation unit for scaling, described image to be detected being carried out after convergent-divergent, before the image rotation predetermined angular to be detected of described rotary unit after to convergent-divergent, the image to be detected after described convergent-divergent is carried out to left and right upset.
Described detecting unit 203 comprises:
Cutting unit (not shown), is suitable for, according to the size of current search window, pretreated Image Segmentation Using to be detected is obtained at least one search subwindow.
Characteristic detection unit (not shown), is suitable for detecting described search subwindow by described dog face property detector 201, until the search subwindow that has described dog face feature detected.
Updating block (not shown), is suitable in the time that described characteristic detection unit can't detect the search subwindow that has described dog face feature, upgrades the size of current search window with preset multiple.
Control module (not shown), when the size that is suitable for the current search window upgrading at described updating block is less than or equal to the size of pretreated image to be detected, controls said units work.
Output unit (not shown), is suitable for, in the time that described characteristic detection unit detects the search subwindow that has described dog face feature, exporting the position of the search subwindow of described dog face feature.
In the present embodiment, the process that described dog face pick-up unit detects dog face can be carried out referring to above-mentioned dog face detecting method, repeats no more herein.
In sum, the technical scheme of the embodiment of the present invention, at least has following beneficial effect:
By the positive sample using dog face characteristic image as Adaboost method, do not comprise the image of described dog face feature as the negative sample of Adaboost method, and then train the performance of the dog face property detector obtaining good by Adaboost method, can detect accurately and rapidly the feature of dog face.
By adopting above-mentioned dog face property detector to detect the dog face in pretreated image to be detected, can detect exactly the position at dog face place, and accuracy when described dog face is detected is high, real-time good.
Further, described pre-service comprises that treating detected image carries out rotating predetermined angular after segmentation convergent-divergent again, while making to adopt described dog face property detector to detect dog face, can detect the poor image to be detected of picture quality, and when treating detected image and carrying out adopting again described dog face property detector to detect dog face after above-mentioned pre-service, can also accelerate the detection speed to thering is high-resolution image to be detected, and then realize the dog face in different images to be detected is detected fast and accurately.
Further, by dog nostril detecting device, the dog nostril in pretreated image to be detected is detected, the dog eyes for the treatment of in detected image by dog eye detector detect, realize take dog nostril and having detected as main, dog eye detection is auxiliary dog face to be detected, due in testing process take dog nostril as main, dog eyes are auxiliary, therefore can remove the detection false-alarm that may hit the nostril of the dog on eyes, and then can be more accurate, realize rapidly the detection to dog face, and take the testing result of dog nostril detecting device as main, the testing result of dog eye detector is auxiliary dog face to be detected, real-time is good, the accuracy detecting is high, false alarm rate is very low.
Although the present invention with preferred embodiment openly as above; but it is not for limiting the present invention; any those skilled in the art without departing from the spirit and scope of the present invention; can utilize method and the technology contents of above-mentioned announcement to make possible variation and modification to technical solution of the present invention; therefore; every content that does not depart from technical solution of the present invention; any simple modification, equivalent variations and the modification above embodiment done according to technical spirit of the present invention, all belong to the protection domain of technical solution of the present invention.

Claims (10)

1. a dog face detecting method, is characterized in that, comprising:
Treat detected image and carry out pre-service;
Adopt dog nostril detecting device to detect the dog nostril in pretreated image to be detected; The preparation method of described dog nostril detecting device comprises: the dog nostril image that extracts the first predetermined quantity; Extract the image that does not comprise dog nostril of the second predetermined quantity, positive sample, the described image that does not comprise dog nostril using described dog nostril image as Adaboost method obtain described dog nostril detecting device as the negative sample of Adaboost method, and described the second predetermined quantity is greater than described the first predetermined quantity; Training parameter in described Adaboost method is set to: positive sample number is more than or equal to 500, negative sample number is described positive sample number 1.5~5 times; Positive/negative sample normalization is of a size of 20 × 20~28 × 28 pixels, and progression is 15~25 grades, and the minimum positive sample percent of pass of every one-level is 0.995~0.998, and the maximum false alarm rate of every one-level is 0.46~0.50;
The dog eyes that adopt dog eye detector to treat in detected image detect; The preparation method of described dog eye detector comprises: the dog eye image that extracts the first predetermined quantity; Extract the image that does not comprise dog eyes of the second predetermined quantity, positive sample, the described image that does not comprise dog eyes using described dog eye image as Adaboost method obtain described dog eye detector as the negative sample of Adaboost method, and described the second predetermined quantity is greater than described the first predetermined quantity; Training parameter in described Adaboost method is set to: positive sample number is more than or equal to 400, negative sample number is described positive sample number 2~4 times; Positive/negative sample normalization is of a size of 10 × 15~20 × 30 pixels, and progression is 15~25 grades, and the minimum positive sample percent of pass of every one-level is 0.995~0.998, and the maximum false alarm rate of every one-level is 0.46~0.50;
The position of the dog eyes that the position in the dog nostril detecting by described dog nostril detecting device and described dog eye detector detect is demarcated described dog face, wherein, when detect that dog nostril and two dog eyes and dog nostril and dog eyes all do not overlap simultaneously, with the position of the location position dog face of the position in the dog nostril that detects and two dog eyes detecting; When detect that dog nostril and dog eye and both do not overlap simultaneously, or dog nostril only detected, with the position of the location position dog face in the dog nostril that detects; When detect that dog nostril and two dog eyes and dog nostril and dog eyes have coincidence simultaneously, with the position of the location position dog face of two dog eyes detecting; When detect that dog nostril and dog eye and both have coincidence simultaneously, or dog eyes only detected, the position of dog face is not demarcated;
The position of the location position dog face of the described position with the dog nostril that detects and two dog eyes detecting comprises by following formula to be demarcated described dog face:
x a = 0.5 × ( x a 2 + x a 1 ) y a = 0.5 × ( y a 2 + y a 1 ) x b = 0.5 × ( x b 2 + x b 1 ) y b = 0.5 × ( y b 2 + y b 1 ) x c = 0.5 × ( x c 2 + x c 1 ) y c = 0.5 × ( y c 2 + y c 1 )
x f 1 = x a - 0.5 × ( x b - x a ) y f 1 = min ( y a , y b ) - 0.25 × ( y c - min ( y a , y b ) ) x f 2 = x b + 0.5 × ( x b - x a ) y f 2 = y c + 0.5 × ( y c - min ( y a , y b ) ) ;
The position of the described location position dog face with the dog nostril that detects comprises by following formula to be demarcated described dog face:
x f 1 = x c 1 - 1.25 × ( x c 2 - x c 1 ) y f 1 = y c 1 - 2.5 × ( y c 2 - y c 1 ) x f 2 = x c 2 + 1.25 × ( x c 2 - x c 1 ) y f 2 = y c 2 + 0.5 × ( y c 2 - y c 1 ) ;
The position of the described location position dog face with two dog eyes detecting comprises by following formula to be demarcated described dog face:
x f 1 = x a 1 - 0.5 × ( x a 2 - x a 1 ) y f 1 = min ( y a 1 , y b 1 ) - 0.5 × ( y a 2 - y a 1 ) x f 2 = x b 2 + 0.5 × ( x b 2 - x b 1 ) x f 2 = max ( y a 2 , y b 2 ) + 0.5 × ( y b 2 - y b 1 ) ;
Wherein, (x a1, y a1) and (x a2, y a2) be respectively the left eye eyeball upper left corner of the dog detecting and the position in the lower right corner, (x b1, y b1) and (x b2, y b2) be respectively the right eye eyeball upper left corner of the dog detecting and the position in the lower right corner, (x c1, y c1) and (x c2, y c2) be respectively the upper left corner, dog nostril that detects and the position in the lower right corner, (x a, y a) be the center of the left eye eyeball of calibrated dog, (x b, y b) be the center of the right eye eyeball of calibrated dog, (x c, y c) be the center in calibrated dog nostril, (x f1, y f1) and (x f2, y f2) be respectively the dog face upper left corner of demarcation and the position in the lower right corner.
2. dog face detecting method as claimed in claim 1, is characterized in that, described in treat detected image and carry out pre-service and comprise:
Based on segmentation zoom factor, described image to be detected is carried out to convergent-divergent, described segmentation zoom factor is associated with the size of dog nostril detecting device;
To the image rotation predetermined angular to be detected after convergent-divergent.
3. dog face detecting method as claimed in claim 2, is characterized in that, described in treat detected image and carry out pre-service and also comprise:
Described image to be detected is being carried out after convergent-divergent, before the image rotation predetermined angular to be detected after convergent-divergent, the image to be detected after convergent-divergent is being carried out to left and right upset.
4. dog face detecting method as claimed in claim 1, is characterized in that, described employing dog nostril detecting device detects and comprises the dog nostril in pretreated image to be detected:
According to the size of current search window, pretreated Image Segmentation Using to be detected is obtained at least one search subwindow;
Detect described search subwindow by described dog nostril detecting device, until the search subwindow that has described dog nostril detected;
If do not exist, upgrade the size of current search window with preset multiple, repeat said process, until the size of current search window is greater than the size of pretreated image to be detected;
There is the position of the search subwindow in described dog nostril in output.
5. dog face detecting method as claimed in claim 1, is characterized in that, described employing dog eye detector is treated dog eyes in detected image and detected and comprise:
Treat detected image according to the size of current search window and cut apart at least one search subwindow of acquisition;
Detect described search subwindow by described dog eye detector, until the search subwindow that has described dog eyes detected;
If do not exist, upgrade the size of current search window with preset multiple, repeat said process, until the size of current search window is greater than the size of image to be detected;
There is the position of the search subwindow of described dog eyes in output.
6. a dog face pick-up unit, is characterized in that, comprising:
The acquisition unit of dog nostril detecting device; The acquisition unit of described dog nostril detecting device comprises: the unit that extracts the dog nostril image of the first predetermined quantity; Extract the unit of the image that does not comprise dog nostril of the second predetermined quantity, positive sample using described dog nostril image as Adaboost method, the described image that does not comprise dog nostril obtain the unit of described dog nostril detecting device as the negative sample of Adaboost method, described the second predetermined quantity is greater than described the first predetermined quantity; Training parameter in described Adaboost method is set to: positive sample number is more than or equal to 500, negative sample number is described positive sample number 1.5~5 times; Positive/negative sample normalization is of a size of 20 × 20~28 × 28 pixels, and progression is 15~25 grades, and the minimum positive sample percent of pass of every one-level is 0.995~0.998, and the maximum false alarm rate of every one-level is 0.46~0.50;
The acquisition unit of dog eye detector; The acquisition unit of described dog eye detector comprises: the unit that extracts the dog eye image of the first predetermined quantity; Extract the unit of the image that does not comprise dog eyes of the second predetermined quantity, positive sample using described dog eye image as Adaboost method, the described image that does not comprise dog eyes obtain the unit of described dog eye detector as the negative sample of Adaboost method, described the second predetermined quantity is greater than described the first predetermined quantity; Training parameter in described Adaboost method is set to: positive sample number is more than or equal to 400, negative sample number is described positive sample number 2~4 times; Positive/negative sample normalization is of a size of 10 × 15~20 × 30 pixels, and progression is 15~25 grades, and the minimum positive sample percent of pass of every one-level is 0.995~0.998, and the maximum false alarm rate of every one-level is 0.46~0.50;
Pretreatment unit, is suitable for treating detected image and carries out pre-service;
Dog nostril detecting unit, is suitable for adopting described dog nostril detecting device to detect the dog nostril in pretreated image to be detected;
Dog eye detection unit, the dog eyes that are suitable for adopting described dog eye detector to treat in detected image detect;
Demarcate unit, be suitable for the position in the dog nostril detecting by described dog nostril detecting unit and described dog eye detection unit inspection to the position of dog eyes described dog face is demarcated;
Described demarcation unit comprises: primary importance is demarcated unit, and the second place is demarcated unit and the 3rd location position unit;
Described primary importance is demarcated unit and is suitable for detecting that dog nostril and two dog eyes and dog nostril and dog eyes all do not overlap simultaneously, with the position of the location position dog face of the position in the dog nostril that detects and two dog eyes detecting;
The described second place is demarcated unit and is suitable for detecting that dog nostril and dog eye and both do not overlap simultaneously, or dog nostril only detected, with the position of the location position dog face in the dog nostril that detects;
Described the 3rd location position unit is suitable for detecting that dog nostril and two dog eyes and dog nostril and dog eyes have coincidence simultaneously, with the position of the location position dog face of two dog eyes detecting;
When detect that dog nostril and dog eye and both have coincidence simultaneously, or dog eyes only detected, described demarcation unit is not demarcated the position of dog face;
Described primary importance is demarcated unit and by following formula, described dog face is demarcated:
x a = 0.5 × ( x a 2 + x a 1 ) y a = 0.5 × ( y a 2 + y a 1 ) x b = 0.5 × ( x b 2 + x b 1 ) y b = 0.5 × ( y b 2 + y b 1 ) x c = 0.5 × ( x c 2 + x c 1 ) y c = 0.5 × ( y c 2 + y c 1 )
x f 1 = x a - 0.5 × ( x b - x a ) y f 1 = min ( y a , y b ) - 0.25 × ( y c - min ( y a , y b ) ) x f 2 = x b + 0.5 × ( x b - x a ) y f 2 = y c + 0.5 × ( y c - min ( y a , y b ) ) ;
The described second place is demarcated unit and by following formula, described dog face is demarcated:
x f 1 = x c 1 - 1.25 × ( x c 2 - x c 1 ) y f 1 = y c 1 - 2.5 × ( y c 2 - y c 1 ) x f 2 = x c 2 + 1.25 × ( x c 2 - x c 1 ) y f 2 = y c 2 + 0.5 × ( y c 2 - y c 1 ) ;
Described the 3rd location position unit is demarcated described dog face by following formula:
x f 1 = x a 1 - 0.5 × ( x a 2 - x a 1 ) y f 1 = min ( y a 1 , y b 1 ) - 0.5 × ( y a 2 - y a 1 ) x f 2 = x b 2 + 0.5 × ( x b 2 - x b 1 ) x f 2 = max ( y a 2 , y b 2 ) + 0.5 × ( y b 2 - y b 1 ) ;
Wherein, (x a1, y a1) and (x a2, y a2) be respectively the left eye eyeball upper left corner of the dog detecting and the position in the lower right corner, (x b1, y b1) and (x b2, y b2) be respectively the right eye eyeball upper left corner of the dog detecting and the position in the lower right corner, (x c1, y c1) and (x c2, y c2) be respectively the upper left corner, dog nostril that detects and the position in the lower right corner, (x a, y a) be the center of the left eye eyeball of calibrated dog, (x b, y b) be the center of the right eye eyeball of calibrated dog, (x c, y c) be the center in calibrated dog nostril, (x f1, y f1) and (x f2, y f2) be respectively the dog face upper left corner of demarcation and the position in the lower right corner.
7. dog face pick-up unit as claimed in claim 6, is characterized in that, described pretreatment unit comprises:
Segmentation unit for scaling, is suitable for, based on segmentation zoom factor, described image to be detected is carried out to convergent-divergent, and described segmentation zoom factor is associated with the size of described dog nostril detecting device:
Rotary unit, is suitable for the image rotation predetermined angular to be detected after convergent-divergent.
8. dog face pick-up unit as claimed in claim 7, is characterized in that, described pretreatment unit also comprises:
Left and right roll-over unit, is suitable at described segmentation unit for scaling, described image to be detected being carried out after convergent-divergent, before the image rotation predetermined angular to be detected of described rotary unit after to convergent-divergent, the image to be detected after described convergent-divergent is carried out to left and right upset.
9. dog face pick-up unit as claimed in claim 6, is characterized in that, described dog nostril detecting unit comprises:
The first cutting unit, is suitable for, according to the size of current search window, pretreated Image Segmentation Using to be detected is obtained at least one search subwindow;
The first detecting unit, is suitable for detecting described search subwindow by described dog nostril detecting device, until the search subwindow that has described dog nostril detected;
The first updating block, is suitable in the time that described the first detecting unit can't detect the search subwindow that has described dog nostril, upgrades the size of current search window with the first preset multiple;
The first control module, when being suitable for the size of current search window after described the first updating block upgrades and being less than or equal to the size of described pretreated image to be detected, controls said units work;
The first output unit, is suitable in the time that described the first detecting unit detects the search subwindow that has described dog nostril, and output exists the position of the search subwindow in described dog nostril.
10. dog face pick-up unit as claimed in claim 6, is characterized in that, described dog eye detection unit comprises:
The second cutting unit, is suitable for treating detected image according to the size of current search window and cuts apart at least one search subwindow of acquisition;
The second detecting unit, is suitable for detecting described search subwindow by described dog eye detector, until the search subwindow that has described dog eyes detected;
The second updating block, is suitable in the time that described the second detecting unit can't detect the search subwindow that has described dog eyes, upgrades the size of current search window with the second preset multiple;
The second control module, when being suitable for the size of current search window after described the second updating block upgrades and being less than or equal to the size of described image to be detected, controls said units work;
The second output unit, is suitable in the time that described the second detecting unit detects the search subwindow that has described dog eyes, and output exists the position of the search subwindow of described dog eyes.
CN201210012738.0A 2012-01-16 2012-01-16 Formation method for dog face characteristic detector as well as dog face detection method and device Active CN102436578B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210012738.0A CN102436578B (en) 2012-01-16 2012-01-16 Formation method for dog face characteristic detector as well as dog face detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210012738.0A CN102436578B (en) 2012-01-16 2012-01-16 Formation method for dog face characteristic detector as well as dog face detection method and device

Publications (2)

Publication Number Publication Date
CN102436578A CN102436578A (en) 2012-05-02
CN102436578B true CN102436578B (en) 2014-06-04

Family

ID=45984633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210012738.0A Active CN102436578B (en) 2012-01-16 2012-01-16 Formation method for dog face characteristic detector as well as dog face detection method and device

Country Status (1)

Country Link
CN (1) CN102436578B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543663A (en) * 2018-12-28 2019-03-29 北京旷视科技有限公司 A kind of dog personal identification method, device, system and storage medium

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102867172B (en) * 2012-08-27 2016-12-21 Tcl集团股份有限公司 A kind of human-eye positioning method, system and electronic equipment
CN103218610B (en) * 2013-04-28 2016-06-08 宁波江丰生物信息技术有限公司 The forming method of dog face detector and dog face detecting method
CN109829381A (en) * 2018-12-28 2019-05-31 北京旷视科技有限公司 A kind of dog only identifies management method, device, system and storage medium
CN110263641A (en) * 2019-05-17 2019-09-20 成都旷视金智科技有限公司 Fatigue detection method, device and readable storage medium storing program for executing
CN113610832B (en) * 2021-08-19 2023-02-10 创优数字科技(广东)有限公司 Logo defect detection method, device, equipment and storage medium
CN115240230A (en) * 2022-09-19 2022-10-25 星宠王国(北京)科技有限公司 Canine face detection model training method and device, and detection method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1731417A (en) * 2005-08-19 2006-02-08 清华大学 Method of robust human face detection in complicated background image
CN101383001A (en) * 2008-10-17 2009-03-11 中山大学 Quick and precise front human face discriminating method
CN101799875A (en) * 2010-02-10 2010-08-11 华中科技大学 Target detection method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7853071B2 (en) * 2006-11-16 2010-12-14 Tandent Vision Science, Inc. Method and system for learning object recognition in images
US7844085B2 (en) * 2007-06-07 2010-11-30 Seiko Epson Corporation Pairwise feature learning with boosting for use in face detection

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1731417A (en) * 2005-08-19 2006-02-08 清华大学 Method of robust human face detection in complicated background image
CN101383001A (en) * 2008-10-17 2009-03-11 中山大学 Quick and precise front human face discriminating method
CN101799875A (en) * 2010-02-10 2010-08-11 华中科技大学 Target detection method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543663A (en) * 2018-12-28 2019-03-29 北京旷视科技有限公司 A kind of dog personal identification method, device, system and storage medium

Also Published As

Publication number Publication date
CN102436578A (en) 2012-05-02

Similar Documents

Publication Publication Date Title
CN102436578B (en) Formation method for dog face characteristic detector as well as dog face detection method and device
US10074020B2 (en) Vehicular lane line data processing method, apparatus, storage medium, and device
CN102163284B (en) Chinese environment-oriented complex scene text positioning method
CN103500322B (en) Automatic lane line identification method based on low latitude Aerial Images
CN105512623B (en) Based on multisensor travelling in fog day vision enhancement and visibility early warning system and method
CN103714343B (en) Under laser line generator lighting condition, the pavement image of twin-line array collected by camera splices and homogenizing method
CN103473564B (en) A kind of obverse face detection method based on sensitizing range
CN108268867B (en) License plate positioning method and device
CN106339657B (en) Crop straw burning monitoring method based on monitor video, device
CN107273816B (en) Traffic speed limit label detection recognition methods based on vehicle-mounted forward sight monocular camera
CN103345631B (en) Image characteristics extraction, training, detection method and module, device, system
KR20170056474A (en) Method, device and storage medium for calculating building height
CN103218610B (en) The forming method of dog face detector and dog face detecting method
CN103902985B (en) High-robustness real-time lane detection algorithm based on ROI
CN109670515A (en) A kind of detection method and system changed for building in unmanned plane image
CN102930287A (en) Overlook-based detection and counting system and method for pedestrians
CN104036278A (en) Extracting method for face algorithm standard face image
CN106887004A (en) A kind of method for detecting lane lines based on Block- matching
CN102073872B (en) Image-based method for identifying shape of parasite egg
CN105354856A (en) Human matching and positioning method and system based on MSER and ORB
CN103679205A (en) Preceding car detection method based on shadow hypothesis and layered HOG (histogram of oriented gradient) symmetric characteristic verification
CN111191535B (en) Pedestrian detection model construction method based on deep learning and pedestrian detection method
CN109460787A (en) IDS Framework method for building up, device and data processing equipment
CN103824060A (en) Method for extracting fingerprint detail points
CN111027534A (en) Compact double-license-plate detection method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Formation method of dog face feature detector, dog face detection method and device

Effective date of registration: 20210302

Granted publication date: 20140604

Pledgee: China Co. truction Bank Corp Yuyao branch

Pledgor: KONFOONG BIOTECH INTERNATIONAL Co.,Ltd.

Registration number: Y2021330000164

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Granted publication date: 20140604

Pledgee: China Co. truction Bank Corp Yuyao branch

Pledgor: KONFOONG BIOTECH INTERNATIONAL Co.,Ltd.

Registration number: Y2021330000164

PC01 Cancellation of the registration of the contract for pledge of patent right