<bdo id='5oQ5o'></bdo><ul id='5oQ5o'></ul>

  • <small id='5oQ5o'></small><noframes id='5oQ5o'>

    <legend id='5oQ5o'><style id='5oQ5o'><dir id='5oQ5o'><q id='5oQ5o'></q></dir></style></legend>

        <tfoot id='5oQ5o'></tfoot>
      1. <i id='5oQ5o'><tr id='5oQ5o'><dt id='5oQ5o'><q id='5oQ5o'><span id='5oQ5o'><b id='5oQ5o'><form id='5oQ5o'><ins id='5oQ5o'></ins><ul id='5oQ5o'></ul><sub id='5oQ5o'></sub></form><legend id='5oQ5o'></legend><bdo id='5oQ5o'><pre id='5oQ5o'><center id='5oQ5o'></center></pre></bdo></b><th id='5oQ5o'></th></span></q></dt></tr></i><div id='5oQ5o'><tfoot id='5oQ5o'></tfoot><dl id='5oQ5o'><fieldset id='5oQ5o'></fieldset></dl></div>

        如何从ios 5中的源图像中检测面部的肤色?

        时间:2023-06-01

        • <i id='Nhp4T'><tr id='Nhp4T'><dt id='Nhp4T'><q id='Nhp4T'><span id='Nhp4T'><b id='Nhp4T'><form id='Nhp4T'><ins id='Nhp4T'></ins><ul id='Nhp4T'></ul><sub id='Nhp4T'></sub></form><legend id='Nhp4T'></legend><bdo id='Nhp4T'><pre id='Nhp4T'><center id='Nhp4T'></center></pre></bdo></b><th id='Nhp4T'></th></span></q></dt></tr></i><div id='Nhp4T'><tfoot id='Nhp4T'></tfoot><dl id='Nhp4T'><fieldset id='Nhp4T'></fieldset></dl></div>

                <tbody id='Nhp4T'></tbody>
              <legend id='Nhp4T'><style id='Nhp4T'><dir id='Nhp4T'><q id='Nhp4T'></q></dir></style></legend>
                <bdo id='Nhp4T'></bdo><ul id='Nhp4T'></ul>

                1. <small id='Nhp4T'></small><noframes id='Nhp4T'>

                  <tfoot id='Nhp4T'></tfoot>
                  本文介绍了如何从ios 5中的源图像中检测面部的肤色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我需要给脸部的皮肤上色...我如何找到肤色?

                  I need to color the skin of the face... How do i find the skin color?

                  现在我通过 RGB 像素值获取肤色...仍然我面临的问题是我正在匹配颜色坐标以匹配特定颜色范围的皮肤......但脸部的某些区域仍然不在我的颜色范围内,那么它不是那个区域的颜色..

                  now i get the skin color by RGB pixel value ... Still i am facing the problem i was matching the color coordinates to match the skin by certain color range... but still some area of the face not fall in my range of colors then it is not color that area..

                  除了面部区域可能落在那个区域之外,那个区域也有颜色......

                  other than the face area may fall that region, that area also colored...

                  关于我的问题的任何想法...

                  Any idea about my issue...

                  提前谢谢....

                  我的代码:

                      -(void)colorImageBySliderValue:(float)value WithImage:(UIImage*)needToModified
                  {
                  
                      CGContextRef ctx;
                  
                      CGImageRef imageRef = needToModified.CGImage;
                      NSUInteger width = CGImageGetWidth(imageRef);
                      NSUInteger height = CGImageGetHeight(imageRef);
                      CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
                      unsigned char *rawData = malloc(self.sourceImage.image.size.height * self.sourceImage.image.size.width * 10);
                      NSUInteger bytesPerPixel = 4;
                      NSUInteger bytesPerRow = bytesPerPixel * self.sourceImage.image.size.width;
                      NSUInteger bitsPerComponent = 8;
                      CGContextRef context1 = CGBitmapContextCreate(rawData, self.sourceImage.image.size.width, self.sourceImage.image.size.height,
                                                                    bitsPerComponent, bytesPerRow, colorSpace,
                                                                    kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
                      CGColorSpaceRelease(colorSpace);
                  
                      CGContextDrawImage(context1, CGRectMake(0, 0, self.sourceImage.image.size.width, self.sourceImage.image.size.height), imageRef);
                  
                      NSLog(@"%d::%d",width,height);
                  
                  
                      for(int ii = 0 ; ii < 768 * 1024 ; ii+=4)
                      {
                  
                          int  R = rawData[ii];
                          int G = rawData[ii+1];
                          int B = rawData[ii+2];
                  
                          //        NSLog(@"%d   %d   %d", R, G, B);
                               if( ( (R>60)&&(R<237) ) || ((G>10)&&(G<120))||((B>4) && (B<120)))
                  //        if( ( (R>100)&&(R<186) ) || ((G>56)&&(G<130))||((B>30) && (B<120)))
                  //        if( ( (R>188)&&(R<228) ) || ((G>123)&&(G<163))||((B>85) && (B<125)))
                              //        if( ( (R>95)&&(R<220) ) || ((G>40)&&(G<210))||((B>20) && (B<170)))
                          {
                  
                  
                              rawData[ii+1]=R;//13; 
                              rawData[ii+2]=G;//43; 
                              rawData[ii+3]=value;//63
                              //            NSLog(@"entered");
                          }
                      }
                  
                  
                      ctx = CGBitmapContextCreate(rawData,
                                                  CGImageGetWidth( imageRef ),
                                                  CGImageGetHeight( imageRef ),
                                                  8,
                                                  CGImageGetBytesPerRow( imageRef ),
                                                  CGImageGetColorSpace( imageRef ),
                                                  kCGImageAlphaPremultipliedLast ); 
                  
                      imageRef = CGBitmapContextCreateImage(ctx);
                      UIImage* rawImage = [UIImage imageWithCGImage:imageRef]; 
                      UIImageView *ty=[[UIImageView alloc]initWithFrame:CGRectMake(100, 200, 400, 400)];
                      ty.image=rawImage;
                      [self.view addSubview:ty];
                      CGContextRelease(context1);
                      CGContextRelease(ctx);  
                      free(rawData);   
                  }
                  

                  问候,

                  间谍网

                  推荐答案

                  您可以创建两个图像,一个是原始图像,另一个是单独修改的图像像素,然后修复...并通过首先添加原始图像并将修改后的像素单独添加到原始图像来覆盖图像....

                  you can create the two images one is the original image and other one is the modified image pixels alone and fix that... and and overlay the images by adding the original image first and the modified pixel alone over the original....

                    for (int index=0; index<length; index+=4) 
                          {
                              if (data2[index]==data1[index])
                              {
                                  data1[index]=data2[index];
                                  data1[index+1]=data2[index+1];//aRed+value;//aRed;//13; 
                                  data1[index+2]=data2[index+2];//aGreen;//aGreen;//43; 
                                  data1[index+3]=data2[index+3];
                              }
                  

                  这篇关于如何从ios 5中的源图像中检测面部的肤色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:从 ACAccountStore 打开 Twitter 设置 (iOS 5.1 TWITTER) 下一篇:iOS Core蓝牙不要求配对

                  相关文章

                  最新文章

                  1. <i id='GVeMG'><tr id='GVeMG'><dt id='GVeMG'><q id='GVeMG'><span id='GVeMG'><b id='GVeMG'><form id='GVeMG'><ins id='GVeMG'></ins><ul id='GVeMG'></ul><sub id='GVeMG'></sub></form><legend id='GVeMG'></legend><bdo id='GVeMG'><pre id='GVeMG'><center id='GVeMG'></center></pre></bdo></b><th id='GVeMG'></th></span></q></dt></tr></i><div id='GVeMG'><tfoot id='GVeMG'></tfoot><dl id='GVeMG'><fieldset id='GVeMG'></fieldset></dl></div>

                    <small id='GVeMG'></small><noframes id='GVeMG'>

                    1. <legend id='GVeMG'><style id='GVeMG'><dir id='GVeMG'><q id='GVeMG'></q></dir></style></legend>

                      • <bdo id='GVeMG'></bdo><ul id='GVeMG'></ul>
                      <tfoot id='GVeMG'></tfoot>