PHP Classes

Image Nudity Filter: Determine whether an image may contain nudity

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (10)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 43%Total: 6,015 All time: 379 This week: 92Up
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: 368 Down5 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  
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

 Version Control Unique User Downloads Download Rankings  
 0%
Total:6,015
This week:0
All time:379
This week:92Up
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:3361
 
an ISLAMIC RULES software license?! It's a shame
5 years ago (harald faro)
0%Star
I love, love your attempt.
11 years ago (Lisa Dawson)
42%StarStarStar
Useless by "islamic rules"-"license" which is not compatible ...
11 years ago (Fenris Erinyer)
2%Star
the package not include valid license,
16 years ago (Jesus Christian Cruz Acono)
45%StarStarStar
great work.
13 years ago (sakthipriyabalaji)
62%StarStarStarStar