{"id":49529,"date":"2024-12-03T14:23:59","date_gmt":"2024-12-03T06:23:59","guid":{"rendered":"https:\/\/fwq.ai\/blog\/49529\/"},"modified":"2024-12-03T14:23:59","modified_gmt":"2024-12-03T06:23:59","slug":"%e5%be%ae%e7%ac%91%e6%a3%80%e6%b5%8b%e5%99%a8%e5%92%8c%e7%85%a7%e7%89%87%e6%8d%95%e6%8d%89","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/49529\/","title":{"rendered":"\u5fae\u7b11\u68c0\u6d4b\u5668\u548c\u7167\u7247\u6355\u6349"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5fae\u7b11\u68c0\u6d4b\u5668\u548c\u7167\u7247\u6355\u6349<\/h1>\n<p><span style=\"font-size: 15px\">\u5b66\u4e60\u77e5\u8bc6\u8981\u5584\u4e8e\u601d\u8003\uff0c\u601d\u8003\uff0c\u518d\u601d\u8003\uff01\u4eca\u5929\u7c73\u4e91\u5c0f\u7f16\u5c31\u7ed9\u5927\u5bb6\u5e26\u6765<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u5fae\u7b11\u68c0\u6d4b\u5668\u548c\u7167\u7247\u6355\u6349\u300b<\/span>\uff0c\u4ee5\u4e0b\u5185\u5bb9\u4e3b\u8981\u5305\u542b<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u4f60\u6b63\u5728\u5b66\u4e60\u6216\u51c6\u5907\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\uff0c\u5c31\u90fd\u4e0d\u8981\u9519\u8fc7\u672c\u6587\u5566~\u8ba9\u6211\u4eec\u4e00\u8d77\u6765\u770b\u770b\u5427\uff0c\u80fd\u5e2e\u52a9\u5230\u4f60\u5c31\u66f4\u597d\u4e86\uff01<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241026\/1729907508671c4b34bfb5a.jpg\" class=\"aligncenter\" title=\"\u5fae\u7b11\u68c0\u6d4b\u5668\u548c\u7167\u7247\u6355\u6349\u63d2\u56fe\" alt=\"\u5fae\u7b11\u68c0\u6d4b\u5668\u548c\u7167\u7247\u6355\u6349\u63d2\u56fe\" \/><\/p>\n<p>\u6982\u8ff0\u5fae\u7b11\u68c0\u6d4b\u5668\u548c\u7167\u7247\u6355\u6349\u5e94\u7528\u7a0b\u5e8f\u5229\u7528 OpenCV \u548c Haar \u7ea7\u8054\u901a\u8fc7\u7f51\u7edc\u6444\u50cf\u5934\u8fdb\u884c\u5b9e\u65f6\u9762\u90e8\u548c\u5fae\u7b11\u68c0\u6d4b\u3002\u5f53\u68c0\u6d4b\u5230\u5fae\u7b11\u65f6\uff0c\u7a0b\u5e8f\u4f1a\u6355\u83b7\u7167\u7247\u5e76\u4f7f\u7528\u5e26\u65f6\u95f4\u6233\u7684\u6587\u4ef6\u540d\u4fdd\u5b58\uff0c\u4ece\u800c\u4f7f\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u521b\u5efa\u5fae\u7b11\u7167\u7247\u96c6\u3002<\/p>\n<p>\u5177\u6709\u5b9e\u65f6\u4eba\u8138\u68c0\u6d4b\u529f\u80fd\uff1a\u4f7f\u7528 Haar \u7ea7\u8054\u5b9e\u65f6\u68c0\u6d4b\u4eba\u8138\u3002\u5fae\u7b11\u68c0\u6d4b\uff1a\u8bc6\u522b\u68c0\u6d4b\u5230\u7684\u9762\u5b54\u4e2d\u7684\u5fae\u7b11\u3002\u7167\u7247\u6355\u6349\uff1a\u68c0\u6d4b\u5230\u5fae\u7b11\u65f6\u81ea\u52a8\u6355\u6349\u5e76\u4fdd\u5b58\u56fe\u50cf\uff0c\u5e76\u7528\u65f6\u95f4\u6233\u547d\u540d\u6587\u4ef6\u3002\u7528\u6237\u53cb\u597d\u7684\u754c\u9762\uff1a\u663e\u793a\u7f51\u7edc\u6444\u50cf\u5934\u6e90\uff0c\u5e76\u5728\u9762\u90e8\u548c\u5fae\u7b11\u5468\u56f4\u68c0\u6d4b\u77e9\u5f62\u3002\u8981\u6c42 Python 3.x OpenCV \u5e93<\/p>\n<p>\u4e0b\u8f7d\u7528\u4e8e\u9762\u90e8\u548c\u5fae\u7b11\u68c0\u6d4b\u7684 Haar \u7ea7\u8054 XML \u6587\u4ef6\uff1ahttps:\/\/github.com\/opencv\/opencv\/tree\/master\/data\/haarcascades<\/p>\n<p>\u68c0\u6d4b\u5230\u5fae\u7b11\u65f6\uff0c\u5c06\u62cd\u6444\u7167\u7247\u5e76\u4ee5\u5e26\u65f6\u95f4\u6233\u7684\u6587\u4ef6\u540d\u4fdd\u5b58\u5728\u5f53\u524d\u76ee\u5f55\u4e2d\uff08\u4f8b\u5982 self-23-09-27-14-30-00.png\uff09\u3002<\/p>\n<p>\u4ee3\u7801\u8bf4\u660e\u89c6\u9891\u6355\u83b7\uff1a\u4f7f\u7528 cv2.VideoCapture(0) \u521d\u59cb\u5316\u7f51\u7edc\u6444\u50cf\u5934\u6e90\u3002\u9762\u90e8\u548c\u5fae\u7b11\u68c0\u6d4b\uff1a\u8be5\u7a0b\u5e8f\u4f7f\u7528 Haar \u7ea7\u8054\u6765\u68c0\u6d4b\u6355\u83b7\u5e27\u4e2d\u7684\u9762\u90e8\u548c\u5fae\u7b11\u3002\u7167\u7247\u6355\u6349\uff1a\u5f53\u68c0\u6d4b\u5230\u5fae\u7b11\u65f6\uff0c\u7a0b\u5e8f\u6355\u6349\u5f53\u524d\u5e27\u5e76\u5c06\u5176\u4fdd\u5b58\u5230\u78c1\u76d8\u5e76\u5e26\u6709\u65f6\u95f4\u6233\u3002\u81f4\u8c22 OpenCV \u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd\u3002 Haar \u7ea7\u8054\u5206\u7c7b\u5668\u7684\u8d21\u732e\u8005\u3002\u8bb8\u53ef\u8bc1 \u8be5\u9879\u76ee\u662f\u5f00\u6e90\u7684\uff0c\u4efb\u4f55\u4eba\u90fd\u53ef\u4ee5\u4f7f\u7528\u548c\u4fee\u6539\u3002 <\/p>\n<p>https:\/\/github.com\/Zedoman\/SElfie-taker <\/p>\n<p>\u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u4e5f\u5c31\u8bb2\u5b8c\u4e86\u300a\u5fae\u7b11\u68c0\u6d4b\u5668\u548c\u7167\u7247\u6355\u6349\u300b\u7684\u5185\u5bb9\u4e86\u3002\u4e2a\u4eba\u8ba4\u4e3a\uff0c\u57fa\u7840\u77e5\u8bc6\u7684\u5b66\u4e60\u548c\u5de9\u56fa\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u7684\u5c06\u5176\u8fd0\u7528\u5230\u9879\u76ee\u4e2d\uff0c\u6b22\u8fce\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u5e26\u4f60\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u77e5\u8bc6\u70b9\uff01<\/p>\n<p>      \u7248\u672c\u58f0\u660e \u672c\u6587\u8f6c\u8f7d\u4e8e\uff1adev.to \u5982\u6709\u4fb5\u72af\uff0c\u8bf7\u8054\u7cfb\u5220\u9664<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5fae\u7b11\u68c0\u6d4b\u5668\u548c\u7167\u7247\u6355\u6349 \u5b66\u4e60\u77e5\u8bc6\u8981\u5584\u4e8e\u601d\u8003\uff0c\u601d\u8003\uff0c\u518d\u601d\u8003\uff01\u4eca\u5929\u7c73\u4e91\u5c0f\u7f16\u5c31\u7ed9\u5927\u5bb6\u5e26\u6765\u300a\u5fae\u7b11\u68c0\u6d4b\u5668\u548c\u7167\u7247\u6355\u6349\u300b\uff0c\u4ee5\u4e0b\u5185\u5bb9\u4e3b\u8981\u5305\u542b\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u4f60\u6b63\u5728\u5b66\u4e60\u6216\u51c6\u5907\u5b66\u4e60\u6587\u7ae0\uff0c\u5c31\u90fd\u4e0d\u8981\u9519\u8fc7\u672c\u6587\u5566~\u8ba9\u6211\u4eec\u4e00\u8d77\u6765\u770b\u770b\u5427\uff0c\u80fd\u5e2e\u52a9\u5230\u4f60\u5c31\u66f4\u597d\u4e86\uff01 \u6982\u8ff0\u5fae\u7b11\u68c0\u6d4b\u5668\u548c\u7167\u7247\u6355\u6349\u5e94\u7528\u7a0b\u5e8f\u5229\u7528 OpenCV \u548c Haar \u7ea7\u8054\u901a\u8fc7\u7f51\u7edc\u6444\u50cf\u5934\u8fdb\u884c\u5b9e\u65f6\u9762\u90e8\u548c\u5fae\u7b11\u68c0\u6d4b\u3002\u5f53\u68c0\u6d4b\u5230\u5fae\u7b11\u65f6\uff0c\u7a0b\u5e8f\u4f1a\u6355\u83b7\u7167\u7247\u5e76\u4f7f\u7528\u5e26\u65f6\u95f4\u6233\u7684\u6587\u4ef6\u540d\u4fdd\u5b58\uff0c\u4ece\u800c\u4f7f\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u521b\u5efa\u5fae\u7b11\u7167\u7247\u96c6\u3002 \u5177\u6709\u5b9e\u65f6\u4eba\u8138\u68c0\u6d4b\u529f\u80fd\uff1a\u4f7f\u7528 Haar \u7ea7\u8054\u5b9e\u65f6\u68c0\u6d4b\u4eba\u8138\u3002\u5fae\u7b11\u68c0\u6d4b\uff1a\u8bc6\u522b\u68c0\u6d4b\u5230\u7684\u9762\u5b54\u4e2d\u7684\u5fae\u7b11\u3002\u7167\u7247\u6355\u6349\uff1a\u68c0\u6d4b\u5230\u5fae\u7b11\u65f6\u81ea\u52a8\u6355\u6349\u5e76\u4fdd\u5b58\u56fe\u50cf\uff0c\u5e76\u7528\u65f6\u95f4\u6233\u547d\u540d\u6587\u4ef6\u3002\u7528\u6237\u53cb\u597d\u7684\u754c\u9762\uff1a\u663e\u793a\u7f51\u7edc\u6444\u50cf\u5934\u6e90\uff0c\u5e76\u5728\u9762\u90e8\u548c\u5fae\u7b11\u5468\u56f4\u68c0\u6d4b\u77e9\u5f62\u3002\u8981\u6c42 Python 3.x OpenCV \u5e93 \u4e0b\u8f7d\u7528\u4e8e\u9762\u90e8\u548c\u5fae\u7b11\u68c0\u6d4b\u7684 Haar \u7ea7\u8054 XML \u6587\u4ef6\uff1ahttps:\/\/github.com\/opencv\/opencv\/tree\/master\/data\/haarcascades \u68c0\u6d4b\u5230\u5fae\u7b11\u65f6\uff0c\u5c06\u62cd\u6444\u7167\u7247\u5e76\u4ee5\u5e26\u65f6\u95f4\u6233\u7684\u6587\u4ef6\u540d\u4fdd\u5b58\u5728\u5f53\u524d\u76ee\u5f55\u4e2d\uff08\u4f8b\u5982 self-23-09-27-14-30-00.png\uff09\u3002 \u4ee3\u7801\u8bf4\u660e\u89c6\u9891\u6355\u83b7\uff1a\u4f7f\u7528 cv2.VideoCapture(0) \u521d\u59cb\u5316\u7f51\u7edc\u6444\u50cf\u5934\u6e90\u3002\u9762\u90e8\u548c\u5fae\u7b11\u68c0\u6d4b\uff1a\u8be5\u7a0b\u5e8f\u4f7f\u7528 Haar \u7ea7\u8054\u6765\u68c0\u6d4b\u6355\u83b7\u5e27\u4e2d\u7684\u9762\u90e8\u548c\u5fae\u7b11\u3002\u7167\u7247\u6355\u6349\uff1a\u5f53\u68c0\u6d4b\u5230\u5fae\u7b11\u65f6\uff0c\u7a0b\u5e8f\u6355\u6349\u5f53\u524d\u5e27\u5e76\u5c06\u5176\u4fdd\u5b58\u5230\u78c1\u76d8\u5e76\u5e26\u6709\u65f6\u95f4\u6233\u3002\u81f4\u8c22 OpenCV \u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd\u3002 Haar \u7ea7\u8054\u5206\u7c7b\u5668\u7684\u8d21\u732e\u8005\u3002\u8bb8\u53ef\u8bc1 \u8be5\u9879\u76ee\u662f\u5f00\u6e90\u7684\uff0c\u4efb\u4f55\u4eba\u90fd\u53ef\u4ee5\u4f7f\u7528\u548c\u4fee\u6539\u3002 https:\/\/github.com\/Zedoman\/SElfie-taker \u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u4e5f\u5c31\u8bb2\u5b8c\u4e86\u300a\u5fae\u7b11\u68c0\u6d4b\u5668\u548c\u7167\u7247\u6355\u6349\u300b\u7684\u5185\u5bb9\u4e86\u3002\u4e2a\u4eba\u8ba4\u4e3a\uff0c\u57fa\u7840\u77e5\u8bc6\u7684\u5b66\u4e60\u548c\u5de9\u56fa\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u7684\u5c06\u5176\u8fd0\u7528\u5230\u9879\u76ee\u4e2d\uff0c\u6b22\u8fce\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u5e26\u4f60\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u77e5\u8bc6\u70b9\uff01 \u7248\u672c\u58f0\u660e \u672c\u6587\u8f6c\u8f7d\u4e8e\uff1adev.to \u5982\u6709\u4fb5\u72af\uff0c\u8bf7\u8054\u7cfb\u5220\u9664<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-49529","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/49529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=49529"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/49529\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=49529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=49529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=49529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}