我遇到了face.com API,我尝试了一个简单的PHP代码来检测面部......
当我尝试使用face.detect API时,我收到了以下响应:
<tag>
<tid>TEMP_F@e4d93bd72df703699dd84ea2f9d6b6de_e200f9aee59fb59a97a325e17f79edcc_74.38_53.56_0_0</tid>
<recognizable>1</recognizable>
<threshold></threshold>
<uids>
</uids>
<gid></gid>
<label></label>
<confirmed>0</confirmed>
<manual>0</manual>
<tagger_id></tagger_id>
<width>18.75</width>
<height>33.33</height>
<center>
<x>74.38</x>
<y>53.56</y>
</center>
<eye_left>
<x>70.51</x>
<y>45.42</y>
</eye_left>
<eye_right>
<x>78.55</x>
<y>45.88</y>
</eye_right>
<mouth_left>
<x>70.35</x>
<y>61.11</y>
</mouth_left>
<mouth_center>
<x>73.95</x>
<y>62.66</y>
</mouth_center>
<mouth_right>
<x>78.09</x>
<y>61.82</y>
</mouth_right>
<nose>
<x>74.01</x>
<y>55.01</y>
</nose>
<ear_left></ear_left>
<ear_right></ear_right>
<chin></chin>
<yaw>-1.46</yaw>
<roll>1.85</roll>
<pitch>1.73</pitch>
<attributes >
<glasses>
<value>false</value>
<confidence>16</confidence>
</glasses>
<smiling>
<value>true</value>
<confidence>84</confidence>
</smiling>
<face>
<value>true</value>
<confidence>93</confidence>
</face>
<gender>
<value>male</value>
<confidence>24</confidence>
</gender>
<mood>
<value>happy</value>
<confidence>18</confidence>
</mood>
<lips>
<value>parted</value>
<confidence>64</confidence>
</lips>
</attributes>
</tag>
问题是:我如何提取脸部图像?我可以看到脸部宽度是18.75,高度是33.33,但是全尺寸是844x450,那么我怎样才能反映这些值以特别用旋转值来抓住脸部?谢谢