iphone camerOverlay for use with Alternate Reality applications

非 Y 不嫁゛ 提交于 2019-12-03 12:37:38
bkritzer

OpenCV makes image overlays remarkably simple, and it's been ported to the iPhone. With OpenCV you can choose to take screenshots as you considered or do image processing on a live stream, one frame at a time. Take a look at some of its tutorial programs, they're really helpful.

There's an UIImagePickerController.overlayView property you might want to set:

// Create a new image picker instance:
UIImagePickerController *picker = [[UIImagePickerController alloc] init];

// Set the image picker source:
picker.sourceType = UIImagePickerControllerSourceTypeCamera;

// Hide the controls:
picker.showsCameraControls = NO;
picker.navigationBarHidden = YES;

// Make camera view full screen:
picker.wantsFullScreenLayout = YES;
picker.cameraViewTransform = CGAffineTransformScale(picker.cameraViewTransform, 1, 1.12412);

// Create an overlay view
// this might need to either 1) be transparent, or 2) be of the other dimensions
OverlayView *overlay = [[OverlayView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height)];

// Insert the overlay:
picker.cameraOverlayView = overlay;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!