PHP Classes

Image Nudity Filter: Determine whether an image may contain nudity

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 43%Total: 6,017 All time: 379 This week: 104Up
Version Licenses PHP version Categories
imagenudityfilter 1.0.0Custom (specified...4Algorithms, Graphics, Artificial inte...
Description 

Author

This class can be used to determine whether an image may contain nudity.

It analyses the colors used in different sections of an image to determine whether those colors match the human skin color tones.

As result of the analysis it returns a score value that reflects the probability of the image to contain nudity.

Additionally, it can output a the analysed image marking the pixels with color skin tones with a given color.

Currently it can analyze images in the PNG, GIF and JPEG images.

Innovation Award
PHP Programming Innovation award nominee
August 2006
Number 2


Prize: One book of choice by SAMS
The widespread availability of nudity pictures is a great concern, especially for parents with young children.

Determining whether a picture contains nudity is also a concern for sites that ban such kinds of pictures. Often they do not have enough human resources to monitor all pictures submitted by the site users.

This class provides a solution that can help determining whether a picture may contain nudity.

It analyses the colors and shapes of the objects in a picture and gives a score value that may help picture content moderators to reduce the search for undesired nudity pictures.

Manuel Lemos
Picture of Bakr Alsharif
Name: Bakr Alsharif <contact>
Classes: 4 packages by
Country: Egypt Egypt
Age: 43
All time rank: 1122 in Egypt Egypt
Week rank: 170 Down4 in Egypt Egypt Down
Innovation award
Innovation award
Nominee: 2x

Example

<?php
//
// +-----------------------------------+
// | Image Filter v 1.0 |
// | http://www.SysTurn.com |
// +-----------------------------------+
//
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the ISLAMIC RULES and GNU Lesser General Public
// License either version 2, or (at your option) any later version.
//
// ISLAMIC RULES should be followed and respected if they differ
// than terms of the GNU LESSER GENERAL PUBLIC LICENSE
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the license with this software;
// If not, please contact support @ S y s T u r n .com to receive a copy.
//

 
if(isset($_FILES['userimage']))
  {
    require_once(
'class.ImageFilter.php');
   
$filter = new ImageFilter;
   
$score = $filter->GetScore($_FILES['userimage']['tmp_name']);
  }
?>
<html>
<head>
    <title>Image Filter Example</title>
</head>
<body>
<?php if(isset($score)){ ?>
<?php if($score >= 30){ ?>
<div style="text-align:center; font-weight:bold; color:#DD0000">Image scored <?php echo $score ?>%<br/><br/>It seems that you have uploaded a nude picture :-(</div>
    <?php } else { ?>
<div style="text-align:center; font-weight:bold; color:#008800">Image scored <?php echo $score ?>%<br/><br/>It seems that you have uploaded a good picture :-)</div>
    <?php } ?>
<?php
} ?>
<div align="center">
<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">
 Filter this image: <input name="userimage" type="file" />
 <input type="submit" value="Filter" style="width:150px" />
</form>
</div>
</body>
</html>


  Files folder image Files (4)  
File Role Description
Plain text file class.ImageFilter.php Class Image Filter main class
Plain text file example.php Example Example
Plain text file license.txt Lic. License
Accessible without login HTML file readme.html Doc. READ ME

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:6,017
This week:0
All time:379
This week:104Up
User Ratings User Comments (5)
 All time
Utility:50%StarStarStar
Consistency:60%StarStarStarStar
Documentation:59%StarStarStar
Examples:60%StarStarStarStar
Tests:-
Videos:-
Overall:43%StarStarStar
Rank:3545
 
an ISLAMIC RULES software license?! It's a shame
6 years ago (harald faro)
0%Star
I love, love your attempt.
12 years ago (Lisa Dawson)
42%StarStarStar
Useless by "islamic rules"-"license" which is not compatible ...
12 years ago (Fenris Erinyer)
2%Star
the package not include valid license,
16 years ago (Jesus Christian Cruz Acono)
45%StarStarStar
great work.
14 years ago (sakthipriyabalaji)
62%StarStarStarStar