Examples and source code of entry-level pornographic image filtering for Java-0.1.0 (simulating the Green Dam filtering mechanism)

Source: Internet
Author: User

File (source code in jar): http://code.google.com/p/greenvm/downloads/list



 

Over the past few days, my praise for the [Green Dam] is like a flood of rivers and rivers, and the Yellow River is like a blow. (Specific can refer to this article: http://blog.csdn.net/cping1982/archive/2009/06/11/4261449.aspx
)

 

I cannot help but start to study the "advanced" Technology of [Image filtering]. So I spent some time this afternoon, it is also "advanced", and implements a Java version of image filtering. Of course, for the sake of Java performance, I didn't intercept images here, but used image occlusion methods to intercept them. By the way, I also tell the netizens which part of the image may be [banned] in [Green Dam] (I used [lime] to cover ......).

PS: before the official opening, in order to reflect the advanced nature of the technology applied in this article, I also learned how to add a lot
[This code can filter bad information in the image, but it does not guarantee that the bad information can be completely filtered, or that the information to be filtered is completely bad information.

]

 

In fact, we all know that Green Dam has adopted a very simple method for verifying the color of the person's skin according to the materials in the [Jin Hui negotiation response book] circulating on the Internet, that is to say, the extracted image area that can be summarized as human flesh is converted into a black or white image (Do you understand why it cannot be verified ?), Then, through the calculation of the Flesh Color Range of the black and white images, the old technology used to determine whether to filter the image is old.

 

The specific implementation process is simplified as follows (For details, refer to the source code provided by the author ):

 

/** <Br/> * use the specified image to mask a large amount of flesh in the target image <br/> * @ Param srcimage <br/> * @ Param deckimage <br /> * @ return <br/> */<br/> Public static image getfleshkeepout (bufferedimage srcimage, <br/> bufferedimage deckimage) {<br/> // obtain reversed skin image <br/> bufferedimage nowimage = fleshdetector. getfleshbinaryimage (srcimage); <br/> // extract the white area from the image (that is, the white area in the skin anti-color image obtained after processing, and 5 indicates the effective range matching range) <br/> bufferedimage nowimage1 = alteration. dilate (nowimage, 5); <br/> // obtain an appropriate covering point <br/> palldetection detect = fleshdetector. detectwhite (nowimage1); <br/> // obtain the target image after "Harmony". <br/> return flesheffector. drawimage (srcimage, detect, deckimage); <br/>}

 

In fact, skin color detection is only a simplification of the original histogram (taking the human body structure to determine the human image), and the inherent problems are still not solved. For example, many landscape images also have large skin color areas, in addition, there are missed judgments caused by the highlight of the skin, and large faces. Using a human face detector to filter large face areas becomes the standard. Introducing more image features, such as textures, can also filter out incorrect landscape images.

 

For details, refer to the source code. Although this is not difficult, it is the same as when I used to write [ai] in a pen ......



For example, in the following operation, like [greendam], the [Chairman] is dropped to [porn] (heaven and earth conscience, the scope of my initial configuration of flesh will not be mistaken [Chairman], the value range changed only after the online [Green Dam] experiment results ......) :

 

 



The machine-cat images on the Internet are safe because they are completely out of the [flesh-colored] range.

 


After I verified it, gafei couldn't pass it, and it was a lot of the picture ......

 

 

Ma Ge, not like Yu Zhao ......

 

 

This, I think, seems more pornographic and more violent after filtering |, It is really good to learn [greendam] to directly block access ......

 

 

 

File (source code in jar): http://code.google.com/p/greenvm/downloads/list


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.