【问题标题】:face.com API , How to detect the face and then extract it?face.com API,如何检测人脸然后提取?
【发布时间】:2012-02-04 04:39:48
【问题描述】:

我遇到了 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,那么我如何反映这些值以特别使用旋转值来抓取面部?谢谢

【问题讨论】:

  • 你有宽度、高度和脸的中心,所以你所要做的就是简单的数学运算。
  • @dev-null-dweller:嗯,中心是 74.38,53.56,是根据图像边缘的人脸中心的 x/y 位置吗?顺便说一句,这不是真的。
  • 不,它们是图像宽度/高度的百分比。
  • 这是我一直在寻找的答案 - 谢谢。

标签: php face-recognition


【解决方案1】:

如 dev-null-dweller 所说,返回值以百分比表示。

查看face.com API Sandbox 以查看响应的可视化。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-08-21
    • 1970-01-01
    • 2016-11-05
    • 2020-10-24
    • 2018-06-19
    • 2018-12-31
    • 2019-11-18
    • 1970-01-01
    相关资源
    最近更新 更多