core image

  • Powerful framework for applying filters to not only image but also to videos and games.

  • Operates on image datatypes from photo library,memory, files,GLTextures(2D and 3D data),live videos etc.

  • Give output in lot of different types like CGImageRef,CAEAGLLayer,Raw Bytes etc.

  • Provides access to built in filters(93 in iOS6 and 120 in OS X).

CORe Image ARCH


KEy Classes in core image


  • CIFilter : class that produces effects. Takes at least one image as an input and produces one output.

  • CIImage : class that holds the image data. The input can be any input source or the output of any CIFilter object.

  • CIContext : An object through Core Image draws a result(image). Can be based on CPU or GPU. 

core image provides


  • Access to built in image processing filters.

  • Feature detection capability.

  • Support for automatic image enhancement.

  • Ability to chain multiple filters to produce custom effects.


Built in filters

Effects provided by Core Image Filters

  • Blur (CIBoxBlur,CIDiscBlur etc).

  • Color Adjustment (CIHueAdjust,CIVibrance etc)

  • Color Effects (CISepiaTone,CIVignette etc).

  • Composite Operations (CIHueBlendMode,CIColorBlendMode etc).

  • Distortion Effect (CICircularWrap,CIBumpDistortion etc.)

BUILtin filters


  • Generator (CIRandomGenerator,CIStripeGenerator etc).

  • Geometry adjustment (CICrop, CILanczosTransform etc).

  • Gradient (CILinerGradient etc).

  • Tile Effect(CIOpTile,CITriangleTile etc).

  • Transition Effect (CIDissolveTransition,CIFlashTransition etc).

  • Others : for HalfTone,Reduction,Sharpen, Styling etc.

Feature Detection capability


  • Does "Face Detection" not "Face Recogntion".

  • Detects the face features like eyes and mouth.

  • Tracks the location of an identified face in case of a video.

CLASSES USED IN FACE DETECTION

CIDetector : class that detect faces in an image.

CIFaceFeature : class that detects the face features(eyes,mouth) and also tracks it.

Automatic image enhancement

It analyses the images for its histogram,face region contents and metadata propertie.

FILTERS USED FOR AUTO ENHANCEMENT

  • CIRedEyeCorrection

  • CIFaceBalance

  • CIVibrance

  • CIToneCurve

  • CIHighlightShadowAdjust

chaining multiple filters

  • Apply first filter on the image

CIImage *outputImage=[CIFilter filterWithName:@"CISepiaTone"  keysAndValues:KCInputImageKey,image, @"inputIntensity",[NSNumber numberWithFloat:0.8] ,nil].outputImage;

  • Apply second filter on the output image of first filter

CIImage *newFilteredImage=[CIFilter filterWithName:@"CIHueAdjust" keysAndvalues:KCInputImageKey,outputImage,@"inputAngle",[NSNumber numberWithFloat:0.8],nil].outputImage;

Best Practices


  • Do not create CIContext again and again.

  • Avoid CA Animations while rendering CIImages with GPU context.

  • CIImages and CIFilter should be autoreleased.

  • Both CPU and GPU context have limits on image sizes.
         -(CGSize) inputImageMaximumSize;
         -(CGSize) outputImageMaximumSize;
  • Use smaller images if possible (good performance) or else crop down the image using Core Graphics framework.

Bye




THANK YOU

core image

By Torry Harris Business Solutions