Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think the easiest path <strong>IS opencv</strong> for what you <strong>want</strong> to do.</p> <p>There's a link about 'simpler' stuff: <a href="http://media.packetlife.net/media/blog/attachments/413/nbar_flesh_tone.html" rel="nofollow noreferrer">http://media.packetlife.net/media/blog/attachments/413/nbar_flesh_tone.html</a> (If you got a Cisco server where you want to prioritize non-flesh colored images.)</p> <p>This thread <a href="https://stackoverflow.com/questions/5168728/nude-image-detection-opencv">Nude image detection - OPENCV</a> Links to : <a href="https://csel.cs.colorado.edu/~xingx/project/privacy.html" rel="nofollow noreferrer">https://csel.cs.colorado.edu/~xingx/project/privacy.html</a> (No code, research on video 'nude' detection.)</p> <p>You can look at O'reilly Opencv book. There's a hsv color space example for flesh color explained there. This book explains it well. (There are some google book pages available if you search.)</p> <p>You can also look at the camshift opencv example. </p> <p>This is a link to the problem space in opencv. (If you want some code, or read a bit about using the color space HSV or CIE L<em>a</em>b* color space) <a href="http://tech.groups.yahoo.com/group/OpenCV/message/45158" rel="nofollow noreferrer">http://tech.groups.yahoo.com/group/OpenCV/message/45158</a></p> <p>Some code copied from that opencv group that gives a mask for the 'flesh color':</p> <pre><code>src_RGB = RGB-Image (IPL_DEPTH_8U , 3); // Source mask_BW = GRAY-Image (IPL_DEPTH_8U , 3);// Resulting Mask same size as source !! //after GetSkinMask you can use cvAnd between src_RGB and mask_BW. void GetSkinMask(IplImage * src_RGB, IplImage * mask_BW, int erosions=1, int dilations=7) { CvSize size; CvSize sz = cvSize( src_RGB-&gt;width &amp; -2, src_RGB-&gt;height &amp; -2); //get the size of input_image (src_RGB) IplImage* pyr = cvCreateImage( cvSize(sz.width/2, sz.height/2), 8, 3 ); //create 2 temp-images IplImage* src = cvCreateImage(cvGetSize(src_RGB), IPL_DEPTH_8U ,3); cvCopyImage(src_RGB, src); IplImage* tmpYCR = cvCreateImage(cvGetSize(src), IPL_DEPTH_8U , 3); cvPyrDown( src, pyr, 7 ); //remove noise from input cvPyrUp( pyr, src, 7 ); cvCvtColor(src ,tmpYCR , CV_RGB2YCrCb); uchar Y; uchar Cr; uchar Cb; CvPixelPosition8u pos_src; CvPixelPosition8u pos_dst; int x =0; int y =0; CV_INIT_PIXEL_POS(pos_src,(unsigned char *) tmpYCR-&gt;imageData, tmpYCR-&gt;widthStep, cvGetSize(tmpYCR), x,y, tmpYCR-&gt;origin); CV_INIT_PIXEL_POS(pos_dst, (unsigned char *) mask_BW-&gt;imageData, mask_BW-&gt;widthStep, cvGetSize(mask_BW), x,y, mask_BW-&gt;origin); uchar * ptr_src; uchar * ptr_dst; for( y=0;y&lt;src-&gt; height; y++) { for ( x=0; x&lt;src-&gt;width; x++) { ptr_src = CV_MOVE_TO(pos_src,x,y,3); ptr_dst = CV_MOVE_TO(pos_dst,x,y,3); Y = ptr_src[0]; Cb= ptr_src[1]; Cr= ptr_src[2]; if( Cr &gt; 138 &amp;&amp; Cr &lt; 178 &amp;&amp; Cb + 0.6 * Cr &gt;200 &amp;&amp; Cb + 0.6 * Cr &lt;215) { ptr_dst[0] = 255; ptr_dst[1] = 255; ptr_dst[2] = 255; } else { ptr_dst[0] = 0; ptr_dst[1] = 0; ptr_dst[2] = 0; } } } if(erosions&gt;0) cvErode(mask_BW,mask_BW,0,erosions); if (dilations&gt;0) cvDilate(mask_BW,mask_BW,0,dilations); cvReleaseImage(&amp;pyr); cvReleaseImage(&amp;tmpYCR); cvReleaseImage(&amp;src); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload