The algorithm is mostly based on this paper:
http://www.math.admu.edu.ph/~raf/pcsc05/proceedings/AI4.pdf
but there are some steps open. I've implemented this algorithm because it's not as hardware intensive as the usual nude detection algorithms (such as searching for specific body parts)