Detect Skin

Embed Size (px)

Citation preview

void process_imageskindetect( void* currentFrame, int yRows, int xPixels);//detect skin areas//process_imageskindetect( (void*)(frameBuffPtr->frame.frameBufferPtr), 480, 720);//detect skinvoid process_imageskindetect( void* currentFrame, int yRows, int xPixels){ int xx = 0; for( xx = 0; xx < (yRows * xPixels)*2; xx+=4 ) {if( (*( ( (unsigned char*)currentFrame ) + xx ) < (unsigned char)(97) || *( ( (unsigned char*)currentFrame ) + xx ) > (unsigned char)(123)) ||(*( ( (unsigned char*)currentFrame ) + xx + 2 ) < (unsigned char)(130) || *( ( (unsigned char*)currentFrame ) + xx + 2 ) > (unsigned char)(160)) || ((*( ( (unsigned char*)currentFrame ) + xx + 1 ) < (unsigned char)(60) || *( ( (unsigned char*)currentFrame ) + xx + 1 ) > (unsigned char)(240))) ){//if((*( ( (unsigned char*)currentFrame ) + xx + 1 ) < 0x70 || *( ( (unsigned char*)currentFrame ) + xx + 1 ) > 0xd0))//{*( ( (unsigned char*)currentFrame ) + xx + 1 ) = 0x00;*( ( (unsigned char*)currentFrame ) + xx ) = 0x80;*( ( (unsigned char*)currentFrame ) + xx + 2 ) = 0x80;}if( (*( ( (unsigned char*)currentFrame ) + xx ) < (unsigned char)(97) || *( ( (unsigned char*)currentFrame ) + xx ) > (unsigned char)(123)) ||(*( ( (unsigned char*)currentFrame ) + xx + 2 ) < (unsigned char)(130) || *( ( (unsigned char*)currentFrame ) + xx + 2 ) > (unsigned char)(160)) || ((*( ( (unsigned char*)currentFrame ) + xx + 3 ) < (unsigned char)(60) || *( ( (unsigned char*)currentFrame ) + xx + 3 ) > (unsigned char)(240))) ){//if((*( ( (unsigned char*)currentFrame ) + xx + 3 ) < 0x70 || *( ( (unsigned char*)currentFrame ) + xx + 3 ) > 0xd0))//{*( ( (unsigned char*)currentFrame ) + xx + 3 ) = 0x00;*( ( (unsigned char*)currentFrame ) + xx ) = 0x80;*( ( (unsigned char*)currentFrame ) + xx + 2 ) = 0x80;//}} } } // End process_imageskindetect()