当前位置:   article > 正文

第五篇 人脸分析CIDetector_hsvcidetector 锐化

hsvcidetector 锐化

参考一个人脸识别的Demo

demo地址 http://code4app.com/ios/5195a56f6803fa4273000000

废话不多 直接上代码

  1.         CIImage *iImage = [CIImage imageWithCGImage:oldImage.CGImage];
  2.         NSDictionary  *opts = [NSDictionary dictionaryWithObject:CIDetectorAccuracyHigh
  3.                                                           forKey:CIDetectorAccuracy];
  4.         CIDetector* detector = [CIDetector detectorOfType:CIDetectorTypeFace
  5.                                                   context:nil
  6.                                                   options:opts];
  7.         //Pull out the features of the face and loop through them
  8.         NSArray* features = [detector featuresInImage:iImage];
  9.         if ([features count]==0) {
  10.             NSLog(@">>>>> 人脸监测【失败】啦 ~!!!");
  11.             [self scaleToFitImageView2:fitHead];
  12.         }else{
  13.             NSLog(@">>>>> 人脸监测【成功】~!!!>>>>>> ");
  14.             for (int i = 0; i<[features count]; i++ ) {
  15.                 
  16.                 CIFaceFeature *f = [features objectAtIndex:i];
  17.                 CGRect faceFrame = f.bounds;//faceFrame的(0,0)点是从左下角开始的;
  18.             }
  19.         }


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/229346
推荐阅读
相关标签
  

闽ICP备14008679号