色情图片识别
来源:互联网 发布:域名注册查询工具 编辑:程序博客网 时间:2024/06/05 08:45
foreach ($posts as $k => $v) { $pics = $v->vPics->get_val(); $filename = $pics[0]->val; $arr = getimagesize($filename); list($width, $height, $type) = getimagesize($filename); switch ($type) { case '1': $rs = imagecreatefromgif($filename); break; case '2': $rs = imagecreatefromjpeg($filename); break; case '3': $rs = imagecreatefrompng($filename); break; } // if ($width>$height) { // $w = 300; // $h = $height*(300/$width); // }else{ // $h = 300; // $w = $width*(300/$height); // } // $rs_thumb = imagecreatetruecolor($w, $h); // imagecopyresampled($rs_thumb, $rs, 0, 0, 0, 0, $w, $h, $width, $height); // 建立输出图像 $out = imagecreatetruecolor($width, $height); $background = imagecolorallocate($out, 0, 0, 0); // 背景设为黑色,失败返回-1 $white = imagecolorallocate($out, 255, 255, 255); $count = 0; for ($x=0; $x < $width; $x++) { for ($y=0; $y < $height; $y++) { $rgb = @imagecolorat($rs, $x, $y); $r = ( $rgb >> 16 ) & 0xFF ; $g = ( $rgb >> 8 ) & 0xFF ; $b = $rgb & 0xFF ; // 判断是否为肤色 if ($r>95 && $g>40 && $b>20 && $r>$g && $r>$b && (max($r,$g,$b)-min($r,$g,$b))>15 && abs($r-$g)>15 && ($r-$b)>20 && ($r-$b)<100 ) { $color = imagecolorallocate($out, $r, $g, $b); imagesetpixel($out, $x, $y, $color); $count++; } } } // echo $count/($width*$height); $data[$k]['pic'] = $filename; $data[$k]['val'] = number_format($count/($width*$height), '5'); $data[$k]['count'] = "{$count}/({$width}*{$height})"; ob_start(); imagejpeg($out); $buffer = ob_get_clean(); ob_end_clean(); $data[$k]['base64'] = 'data:image/jpeg;base64,'.chunk_split(base64_encode($buffer));}$this->rsts = $data;
0 0
- 色情图片识别
- Python 3 色情图片识别
- Python 3 色情图片识别
- Python3 色情图片识别
- 数学的用途:色情图片识别
- 数学的用途:色情图片识别
- 【严肃脸】使用caffe实现色情图片的识别
- 雅虎开源色情图片检测神经网络
- Resnet改进的色情图片检测-nsfw
- 微信自动检测色情图片_python +itchat
- 基于IE浏览器的色情图片过滤器的设计和实现
- 识别
- 识别
- OpenCV实践之路——雅虎色情图片检测神经网络试用报告
- 车牌识别 字符识别
- 语音识别---识别流程
- 身份证识别,银行卡识别,名片识别
- 证件识别,银行卡识别,车牌识别等
- [OpenGL ES 07-1]光照原理
- 17个提升iOS开发效率的必用工具
- Jitter Removal in Image and Sequence
- Servlet与jsp的“一语惊醒梦中人”的区别
- 【工业4.0时代,怎样为孩子筹备未来的教育?】有感
- 色情图片识别
- android ListView 几个重要属性
- JAR命令&JAR包详解
- 高德地图开发【覆盖物显示——Marker的使用(一)】
- android 键盘与输入框问题
- 基于项目需求开发JMeter插件
- oracle 中clob数据在Java类 里sql处理
- HTTP响应头和请求头信息对照表
- 我的第一篇博客