文件名称:基于肤色的人脸检测与眼睛定位论文及程序
文件大小:4.93MB
文件格式:RAR
更新时间:2012-11-03 13:10:24
VC MFC 人脸检测 肤色
VC编程,含毕设论文,程序! 程序片段如下: void COpenbmpfileView::Onsearch() { COpenbmpfileDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); int x, y; double R,G,B,I,U,V,seta; CDC* dc = GetDC(); for( y = 0; y < bmpHeight; y++ ) { for( x = 0; x < bmpWidth; x++) { switch( bmpBitCount ) { case 1: break; case 4: break; case 8: R = pbmpPalette[pbmpSizeImage[bmpLineByte * ( bmpHeight - y - 1) + x]].rgbRed; G = pbmpPalette[pbmpSizeImage[bmpLineByte * ( bmpHeight - y - 1) + x]].rgbGreen; B = pbmpPalette[pbmpSizeImage[bmpLineByte * ( bmpHeight - y - 1) + x]].rgbBlue; U = -0.148 * R - 0.289 * G + 0.437 * B; V = 0.615 * R - 0.515 * G - 0.100 * B; I = 0.596 * R - 0.275 * G - 0.321 * B; seta=atan( V/U ); //if(I<=55 && I>=30 && seta>=-3.14*66/180 && seta<=-3.14*50/180) if(I <= 90 && I >= 20 && seta >= -3.14 * 80/180 && seta <= -3.14 * 30 /180) dc -> SetPixel( x+500, y, RGB(255,255,255)); else dc -> SetPixel( x+500, y, RGB( pbmpPalette[pbmpSizeImage[bmpLineByte * ( bmpHeight - y - 1) + x]].rgbRed, pbmpPalette[pbmpSizeImage[bmpLineByte * ( bmpHeight - y - 1) + x]].rgbGreen, pbmpPalette[pbmpSizeImage[bmpLineByte * ( bmpHeight - y - 1) + x]].rgbBlue)); break; case 24: R = pbmpSizeImage[bmpLineByte * ( bmpHeight - y - 1 ) + 3 * x + 2]; G = pbmpSizeImage[bmpLineByte * ( bmpHeight - y - 1 ) + 3 * x + 1]; B = pbmpSizeImage[bmpLineByte * ( bmpHeight - y - 1 ) + 3 * x] ; U = -0.148 * R - 0.289 * G + 0.437 * B; V = 0.615 * R - 0.515 * G - 0.100 * B; I = 0.596 * R - 0.275 * G - 0.321 * B; //seta=V/U; seta=atan(V/U); if(I <= 90 && I >= 20 && seta >= -3.14 * 80 / 180 && seta <= -3.14 * 30 / 180) //if(I<=90 && I>=20 && seta>=-5.671282&& seta<=-0.5773503) dc -> SetPixel( x + 500, y, RGB(255,255,255)); else dc -> SetPixel( x + 500, y, RGB(pbmpSizeImage[bmpLineByte * ( bmpHeight - y - 1 ) + 3 * x + 2], pbmpSizeImage[bmpLineByte * ( bmpHeight - y - 1 ) + 3 * x + 1], pbmpSizeImage[bmpLineByte * ( bmpHeight - y - 1 ) + 3 * x] ) ); break; default: AfxMessageBox( "Invalid color numbers!", MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION | MB_APPLMODAL ); break; } } } }
【文件预览】:
论文及程序
----毕设论文.pdf(1.21MB)
----定稿程序修订版.rar(3.85MB)