赞
踩
源码下载:人脸检测并打马赛克源码
前提是已经安装好 Python3 和 包管理工具 pip。
pip install opencv-contrib-python
以下是在 Windows 的 cmd 中安装过程:
C:\Users\Admin>pip install opencv-contrib-python Collecting opencv-contrib-python Downloading https://files.pythonhosted.org/packages/8f/2a/a835183c0e05af3f1d355869e852ba35356ca37a66a0186749cb912648eb/opencv_contrib_python-4.2.0.34-cp38-cp38-win_amd64.whl (39.5MB) |████████████████████████████████| 39.5MB 3.3MB/s Collecting numpy>=1.17.3 (from opencv-contrib-python) Downloading https://files.pythonhosted.org/packages/df/f3/3fdea08ad680100b5e7abf810a154ce142a63266df1abfdca5cb0f66cca1/numpy-1.19.0-cp38-cp38-win_amd64.whl (13.0MB) |████████████████████████████████| 13.0MB 2.2MB/s Installing collected packages: numpy, opencv-contrib-python Successfully installed numpy-1.19.0 opencv-contrib-python-4.2.0.34 C:\Users\Admin>python Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import cv2 >>> cv2.__version__ '4.2.0' >>>
说明:
通过命令行方式运行:
# 运行方式1:高斯模糊
$ python blur_face.py --image examples/group_photo.jpg --face face_detector --method simple
# 运行方式2:像素化模糊(马赛克)
$ python blur_face.py --image examples/group_photo.jpg --face face_detector --method pixelated
备注:–image 参数后为图片文件的相对路径或绝对路径。
像素模糊:
高斯模糊:
像素模糊:
高斯模糊:
像素模糊:
高斯模糊:
像素模糊:
高斯模糊:
像素模糊:
高斯模糊:
像素模糊:
高斯模糊:
像素模糊:
高斯模糊:
像素模糊:
高斯模糊:
像素模糊:
高斯模糊:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。