Green box on iPhone 5

I am using UIImagePickerController

to show the back camera as a background. Everything works as expected, but in iPhone 5

and maybe in iPhone 4s

I have a green square in the image, like

face detection

I think this is a face recognition feature, but I cannot turn it off. Any suggestion?

This is the piece of code I'm using for UIImagePickerController

:
I am declaring a UIView declaration in a .h file.

UIView *overlay;

      

And in the init method of my .m file

#define CAMERA_TRANSFORM  1.24299

UIImagePickerController *uip;

@try {
      uip = [[[UIImagePickerController alloc] init] autorelease];
      uip.sourceType = UIImagePickerControllerSourceTypeCamera;
      uip.showsCameraControls = NO;
      uip.toolbarHidden = YES;
      uip.navigationBarHidden = YES;
      uip.wantsFullScreenLayout = YES;
      uip.cameraViewTransform = CGAffineTransformScale(uip.cameraViewTransform, CAMERA_TRANSFORM, CAMERA_TRANSFORM);
}
@catch (NSException * e) {
    [uip release];
    uip = nil;
}
@finally {
    if(uip) {
        [overlay addSubview:[uip view]];
        [overlay release];
    }
}

      

+3


source to share


1 answer


Take a look at this post

Its problem was the other way around, I'm sure if you tweak the settings for the feature detector you can turn it off if it doesn't turn rotary, just try running it in mirror mode or up and down and it won't be able to detect faces and will seem "off "

but I'm pretty sure it can be disabled.

Here's another link I found Also check out the class link

Update:

Warning: I don't recommend using this at all, just to show the way I managed to hide these fields, it will break sooner or later.



After a little hack, I was able to track down the sub item containing these little squares and set its hidden property to YES

just, at the end of your init code, you create a KeyAndVisible, add to this:

[[[[[[[[[[[[[[uip childViewControllers] objectAtIndex:0] view]
subviews] objectAtIndex:0]
subviews] objectAtIndex:0]
subviews] objectAtIndex:0]
subviews] objectAtIndex:0]
subviews] objectAtIndex:0]
setHidden:YES];

      

Sorry for the bad formatting, I'm in a hurry, but you have an idea. Also, during the mess, I found that you can control the Camera Iris view and some other features. but that should do the trick.Also, it won't disable face detection, which means that when the user finishes selecting, you will know how many face features are detected!

I also think this will ONLY work on iPhone 4 and up !, you need to test a lot, this is a really bad hacker that I don't recommend using in production applications!

0


source







All Articles