Python基于YCbCr 肤色模型的情色图片检测的简单实现
来源:互联网 发布:mac md文件阅读器 编辑:程序博客网 时间:2024/04/20 07:17
<span style="color: rgb(54, 46, 43); font-family: Arial; font-size: 14px; line-height: 26px;"><strong>Python基于YCbCr 肤色模型的情色图片检测的简单实现</strong></span>
#Detection of Pornographic Digital Images#YCbCr Model#author:Robin chen#input:the dir of an image'''ref:1.http://www.naun.org/multimedia/NAUN/computers/20-462.pdf2.http://blog.csdn.net/gzlaiyonghao/article/details/3166735'''from PIL import Imageimport sysdef image_ifo(image): try: img = Image.open(image) except Exception,e: print "Can not open the image!" print 'Image Mode:%s,Image Size:%s,Image Format:%s' % (img.mode,img.size,img.format) return imgdef preprocessed_image(image): img = image_ifo(image) if not img.mode == 'YCbCr': img = img.convert('YCbCr') return img def detector(image): img = preprocessed_image(image) ycbcr_data = img.getdata() W,H = img.size THRESHOLD = 0.3 count = 0 for i,ycbcr in enumerate(ycbcr_data): y,cb,cr = ycbcr #if 80 <= cb <= 120 and 133 <= cr <= 173: if 86 <= cb <= 127 and 130 <= cr < 168: count += 1 if count > THRESHOLD*W*H: print 'The image is pornographic!' else: print 'The image is not pornographic!' if __name__ == '__main__': image = sys.argv[-1] print 'Detector is working on it,please wait a second...' detector(image) print 'Detecting is done!'
0 0
- Python基于YCbCr 肤色模型的情色图片检测的简单实现
- 基于YCbCr的肤色检测OpenCV实现
- OpenCV Using Python——RGB颜色空间和YCbCr颜色空间的混合肤色检测
- 肤色检测算法 - 基于二次多项式混合模型的肤色检测。
- 肤色检测算法 - 基于二次多项式混合模型的肤色检测
- 肤色检测算法 - 基于二次多项式混合模型的肤色检测。
- YCbCr颜色空间下的一个简便的肤色模型
- 人脸--基于肤色模型的人脸检测研究
- 基于统计的肤色检测
- 基于opencv的肤色检测
- 人脸检测---基于肤色检测的实现
- 基于人脸检测的肤色采集以及两种常见肤色模型建模
- OpenCV Using Python——HSV颜色空间和改进的YCbCr颜色空间中的肤色检测
- 自己做的一个肤色检测模型
- 基于椭圆模块的肤色检测
- 基于贝叶斯判决的肤色检测
- 基于肤色的人脸检测
- 肤色检测算法 - 基于不同颜色空间简单区域划分的皮肤检测算法
- 仿qq搜索动画效果
- 安装cocos2dx
- 深入探讨 Java 类加载器
- wordpress博客建站网赚高级应用系列教程
- QQ侧边栏效果(UIViewController添加子视图控制器)
- Python基于YCbCr 肤色模型的情色图片检测的简单实现
- jdk1.5高新技术(二)
- 几个opencv自带测试视频
- HDU-5135 广州现场赛题
- 答辩PPT注意事项
- LeetCode Sort List
- 最新wp建站做淘宝客系统教程(共6课)附源码
- 【hibernate框架】hibernate的ID的生成策略剖析
- uva 216 Getting in Line (暴力枚举)