cifacefeature

How to use CIDetector and CIFaceFeature with large images and different aspect ratios

南笙酒味 提交于 2020-01-06 02:55:08
问题 I've been working on this for days and all examples out there are if the image size is the same as the UIImageView. In addition, a lot of the answered on Stack are outdated. I have an app where the user can add an image, which can be of any size, and different aspect ratio, for example 750X750, 1280X920. The UIImageView is smaller of course, and the content mode is set to Aspect Fill. I did a lot of testing so this is what I have done so far: I convert the CoreImage coordinates to UIKit using

iOS face detector orientation and setting of CIImage orientation

好久不见. 提交于 2019-12-09 07:00:14
问题 EDIT found this code that helped with front camera images http://blog.logichigh.com/2008/06/05/uiimage-fix/ Hope others have had a similar issue and can help me out. Haven't found a solution yet. (It may seem a bit long but just a bunch of helper code) I'm using the ios face detector on images aquired from the camera (front and back) as well as images from the gallery (I'm using the UIImagePicker - for both image capture by camera and image selection from the gallery - not using avfoundation

Transform an Image using CIFaceFeature in iOS

拥有回忆 提交于 2019-12-04 19:24:35
I use CIDetector and CIFaceFeature to detect face on the front facing camera. Also trying to place a hat on the head. The hat is placing fine when the head is straight. If I tilt my head the hat goes small and goes away from head. Code use to add the hat, self.hatImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:selectedImageName]]; self.hatImgView.contentMode = UIViewContentModeScaleAspectFit; [self.previewView addSubview:self.hatImgView]; Detecting the face and movement, - (void)detectedFaceController:(DetectFace *)controller features:(NSArray *)featuresArray forVideoBox:

Cut rounded image with the face from CIDetector and CIFaceFeature

青春壹個敷衍的年華 提交于 2019-12-04 09:12:50
问题 How to cut the frame that I receive as faceViewBounds to make a big circle around the face? It's like a badge with the face of the person. Maybe I should get the center of faceViewBounds then I have to find this center in theImageView.image and draw a circle with big diameter and then cut the rest outside of the circle by logic, but with code I don't know how to do it.. Any suggestions? func detectFaceFrom(ImageView theImageView: UIImageView) { guard let personImage = CIImage(image:

iOS face detector orientation and setting of CIImage orientation

六眼飞鱼酱① 提交于 2019-12-03 08:54:16
EDIT found this code that helped with front camera images http://blog.logichigh.com/2008/06/05/uiimage-fix/ Hope others have had a similar issue and can help me out. Haven't found a solution yet. (It may seem a bit long but just a bunch of helper code) I'm using the ios face detector on images aquired from the camera (front and back) as well as images from the gallery (I'm using the UIImagePicker - for both image capture by camera and image selection from the gallery - not using avfoundation for taking pictures like in the squarecam demo) I am getting really messed up coordinates for the

CIDetector and UIImagePickerController

半世苍凉 提交于 2019-11-29 02:31:33
I'm trying to implement the built-in iOS 5 face detection API. I'm using an instance of UIImagePickerController to allow the user to take a photo and then I'm trying to use CIDetector to detect facial features. Unfortunately, featuresInImage always returns an array of size 0. Here's the code: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage* picture = [info objectForKey:UIImagePickerControllerOriginalImage]; NSNumber *orientation = [NSNumber numberWithInt: [picture imageOrientation]]; NSDictionary *imageOptions =

CIDetector and UIImagePickerController

有些话、适合烂在心里 提交于 2019-11-27 21:54:39
问题 I'm trying to implement the built-in iOS 5 face detection API. I'm using an instance of UIImagePickerController to allow the user to take a photo and then I'm trying to use CIDetector to detect facial features. Unfortunately, featuresInImage always returns an array of size 0. Here's the code: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage* picture = [info objectForKey:UIImagePickerControllerOriginalImage]; NSNumber