Professional Documents
Culture Documents
● Blending
Basic concepts
• What’s Image Processing?
=> Input + mathematical operation -> output
Input: image, filter, video, output of another one
Mathematical operation: fill color, detect egde, detect face
algorithm, color lookup, Gaussian algorithm …
Output: like input :D
Basic concepts
● Graphic Context: a global state object that holds all the
infomation for drawing.
○ Store resource, state
○ Generate result …
Basic concepts
• Filter: allows us to apply various effects on image, able
chaining
• Capture mode: still and real-time
Basic concepts
What are Apple definitions?
● Core Image
- Greate framework built-in on Apple systems.
- Operate data types from Core Graphics, Core Video and
Image I/O frameworks using either a GPU or CPU rendering
path.
Basic concepts
● Context: CIContext, CGContextRef
● Input and output representation: CIImage, CGImage,
UIImage, Video(Data)
● Filter: CIFilter
Basic concepts
• CIContext
An evaluation context for rendering image processing
results and performing image analysis.
import CoreImage
import Metal
let device = MTLCreateSystemDefaultDevice()
let ciContext = CIContext(mtlDevice: device)
Advanced operations
● Shading: use GPU to perform image and video
manipulation much faster than could be done in CPU-
bound routine
● Example: gamma filter
-> 40x faster than Core Image
-> 180x faster than CPU-bound
Advanced operations
● Shader: actual complex to build but very powerful
● Suggested open frameworks: GPUImage
void main()
{
gl_Position = transformMatrix * vec4(position.xyz, 1.0) * orthographicMatrix;
textureCoordinate = inputTextureCoordinate.xy;
}
)
Advanced operations
● Kernel: actual complex to build but very powerful
● Suggested open frameworks: Vivid