#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.pdf
2.http://blog.csdn.net/gzlaiyonghao/article/details/3166735
'''
from PIL import Image
import sys
def 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 img
def preprocessed_image(image):
img = image_ifo(image)
if not img.mode