1 | <?php |
||
21 | class Face extends Entropy |
||
22 | { |
||
23 | const CLASSIFIER_FACE = '/classifier/haarcascade_frontalface_default.xml'; |
||
24 | const CLASSIFIER_PROFILE = '/classifier/haarcascade_profileface.xml'; |
||
25 | |||
26 | /** |
||
27 | * safeZoneList |
||
28 | * |
||
29 | * @var array |
||
30 | * @access protected |
||
31 | */ |
||
32 | protected static $safeZoneList = array(); |
||
33 | |||
34 | /** |
||
35 | * originalImage |
||
36 | * |
||
37 | * @var object |
||
38 | * @access protected |
||
39 | */ |
||
40 | protected static $originalImage; |
||
41 | |||
42 | /** |
||
43 | * baseDimension |
||
44 | * |
||
45 | * @var array |
||
46 | * @access protected |
||
47 | */ |
||
48 | protected static $baseDimension = array(); |
||
49 | |||
50 | /** |
||
51 | * Returns the x,y values. |
||
52 | * |
||
53 | * @param Imagick $original |
||
54 | * @param int $targetWidth |
||
55 | * @param int $targetHeight |
||
56 | * |
||
57 | * @return array |
||
58 | */ |
||
59 | public static function getOffsets(Imagick $original, $targetWidth, $targetHeight) |
||
69 | |||
70 | /** |
||
71 | * getBaseDimension |
||
72 | * |
||
73 | * @param string $key width|height |
||
74 | * |
||
75 | * @access protected |
||
76 | * |
||
77 | * @return int |
||
78 | */ |
||
79 | protected static function getBaseDimension($key) |
||
89 | |||
90 | /** |
||
91 | * getFaceList get faces positions and sizes |
||
92 | * |
||
93 | * @access protected |
||
94 | * |
||
95 | * @return array |
||
96 | */ |
||
97 | protected static function getFaceList() |
||
117 | |||
118 | /** |
||
119 | * getFaceListFromClassifier |
||
120 | * |
||
121 | * @param string $classifier |
||
122 | * |
||
123 | * @access protected |
||
124 | * |
||
125 | * @return array |
||
126 | */ |
||
127 | protected static function getFaceListFromClassifier($classifier) |
||
139 | |||
140 | /** |
||
141 | * getSafeZoneList |
||
142 | * |
||
143 | * @access protected |
||
144 | * |
||
145 | * @return array |
||
146 | */ |
||
147 | protected static function getSafeZoneList() |
||
187 | } |
||
188 |