Tag: ciface

iOS人脸检测器的方向和CIImage方向的设置

编辑发现这个代码,帮助前摄像头图像http://blog.logichigh.com/2008/06/05/uiimage-fix/ 希望其他人也有类似的问题,可以帮助我。 尚未find解决scheme。 (这可能看起来有点长,但只是一堆帮手代码) 我在相机(正面和背面)获取的图像上使用了ios脸部检测器,以及图库中的图像(我正在使用UIImagePicker – 用于通过相机捕捉图像并从图库中select图像 – 不使用漫射用于在Squarecam演示中拍摄照片) 我真的搞砸了检测的坐标(如果有的话),所以我写了一个简短的debugging方法来获取面的边界以及一个实用工具,他们在上面绘制了一个正方形,我想检查检测器的方向正在工作: #define RECTBOX(R) [NSValue valueWithCGRect:R] – (NSArray *)detectFaces:(UIImage *)inputimage { _detector = \[CIDetector detectorOfType:CIDetectorTypeFace context:nil options:\[NSDictionary dictionaryWithObject:CIDetectorAccuracyLow forKey:CIDetectorAccuracy\]\]; NSNumber *orientation = \[NSNumber numberWithInt:\[inputimage imageOrientation\]\]; // i also saw code where they add +1 to the orientation NSDictionary *imageOptions = \[NSDictionary dictionaryWithObject:orientation forKey:CIDetectorImageOrientation\]; CIImage* ciimage = \[CIImage […]