This presentation that we're going to talk about how to use CameraKit to implement high performance real-time camera app. We also will cover the tips that you should know when you implement customized camera feature in your app.
3. What the CameraKit can do?
High performance real-time computing with camera
CPU & GPU rendering solutions
Demos with sample apps
3
Agenda
Making Camera Amazing
15. 15
Initializing a camera
Making Camera Amazing
camera = [[ADKCamera alloc] initCameraWithDelegate:self
quality:AVCaptureSessionPresetLow
position:ADKCameraPositionRear];
camera.alignDeviceOrientation = YES;
17. 17
Camera Viewfinder Preview
Making Camera Amazing
// Adding preview layer on the screen.
[view.layer addSublayer:camera.captureVideoPreviewLayer]
// Starting to capture images.
[camera startCamera];
18. 18
Taking photos / videos
Making Camera Amazing
// Capturing a high quality photo.
[camera captureImage:^(UIImage *image,
NSDictionary *exifDic,
NSError *error) {
// Using the image to do something…
}
35. 35
Display Images
Making Camera Amazing
dispatch_async(dispatch_get_main_queue(), ^{
// Actually, this is a bad idea!
UIImage *image = [UIImage imageWithCIImage:filteredCoreImage];
imageView.image = image;
});
36. CPU & GPU rendering
solutions
36Making Camera Amazing
37. 37
Poor Performance Flow
Making Camera Amazing
CVPixelBuffer
CIImage
CVPixelBuffer
CIContext
EAGLContext
UIImage UIImageView
44. 44
Better Performance Flow
Making Camera Amazing
CVPixelBuffer
CIImage
CVPixelBuffer
CIContext
EAGLContext ADKOpenGLImageView
UIImage UIImageView
45. 45
Using ADKOpenGlImageView
Making Camera Amazing
// Set up config and assign a image for displaying.
glImageView.contentMode =
ADKOpenGLImageViewContentModeScaleAspectFill;
glImageView.backgroundColor = [UIColor black];
glImageView.image = finalCoreImage;
47. ADKCamera makes things simple
Using GPU to process image will be better (EX: CoreImage…)
ADKOpenGLImageView provides an OpenGL solution
47
Summary
Making Camera Amazing