图片处理 (Image processing)
-
GPUImageTransformFilter: This applies an arbitrary 2-D or 3-D transformation to an image
- affineTransform: This takes in a CGAffineTransform to adjust an image in 2-D
- transform3D: This takes in a CATransform3D to manipulate an image in 3-D
- ignoreAspectRatio: By default, the aspect ratio of the transformed image is maintained, but this can be set to YES to make the transformation independent of aspect ratio
-
GPUImageCropFilter: This crops an image to a specific region, then passes only that region on to the next stage in the filter
- cropRegion: A rectangular area to crop out of the image, normalized to coordinates from 0.0 - 1.0. The (0.0, 0.0) position is in the upper left of the image.
GPUImageLanczosResamplingFilter: This lets you up- or downsample an image using Lanczos resampling, which results in noticeably better quality than the standard linear or trilinear interpolation. Simply use -forceProcessingAtSize: to set the target output resolution for the filter, and the image will be resampled for that new size.
-
GPUImageSharpenFilter: Sharpens the image
- sharpness: The sharpness adjustment to apply (-4.0 - 4.0, with 0.0 as the default)
-
GPUImageUnsharpMaskFilter: Applies an unsharp mask
- blurRadiusInPixels: The blur radius of the underlying Gaussian blur. The default is 4.0.
- intensity: The strength of the sharpening, from 0.0 on up, with a default of 1.0
-
GPUImageGaussianBlurFilter: 硬件优化的、半径可变的高斯模糊(Gaussian blur)。
-
texelSpacingMultiplier
: 纹理元素间距的乘数(A multiplier for the spacing between texels), 范围从0
开始,默认是1.0
。提高该参数会增加模糊强度,但会在结果中引入伪影(artifacts)。 强烈建议接触该参数前,先使用其他参数。 -
blurRadiusInPixels
: 用于模糊的半径(以像素为单位),默认值为2.0
。这会调整高斯分布函数(distribution function)中的sigma变量。 -
blurRadiusAsFractionOfImageWidth
: -
blurRadiusAsFractionOfImageHeight
: 设置这些属性将允许模糊半径随图像的大小缩放。 这些属性是互斥的(mutually exclusive); 设置其中任意一个将会使另一个置为0。(Setting these properties will allow the blur radius to scale with the size of the image.) -
blurPasses
: 模糊次数。 值越大,过滤器(filter)越慢。
-
-
GPUImageBoxBlurFilter: 硬件优化的、半径可变的方框模糊(box blur)。
-
texelSpacingMultiplier
: A multiplier for the spacing between texels, ranging from 0.0 on up, with a default of 1.0. Adjusting this may slightly increase the blur strength, but will introduce artifacts in the result. Highly recommend using other parameters first, before touching this one. -
blurRadiusInPixels
:用于模糊半径(以像素为单位),默认值为2.0
。这会调整高斯分布函数(distribution function)中的sigma
变量。 -
blurRadiusAsFractionOfImageWidth
: -
blurRadiusAsFractionOfImageHeight
: Setting these properties will allow the blur radius to scale with the size of the image -
blurPasses
: 模糊次数。值越大,模糊的越慢。
-
-
GPUImageSingleComponentGaussianBlurFilter: 基于GPUImageGaussianBlurFilter的修改,仅对红色组件进行操作。
-
texelSpacingMultiplier
: A multiplier for the spacing between texels, ranging from 0.0 on up, with a default of 1.0. Adjusting this may slightly increase the blur strength, but will introduce artifacts in the result. Highly recommend using other parameters first, before touching this one. -
blurRadiusInPixels
: 用于模糊半径(以像素为单位),默认值为2.0
。这会调整高斯分布函数(distribution function)中的sigma
变量。 -
blurRadiusAsFractionOfImageWidth
: -
blurRadiusAsFractionOfImageHeight
: Setting these properties will allow the blur radius to scale with the size of the image -
blurPasses
: 模糊次数。值越大,模糊的越慢。
-
-
GPUImageGaussianSelectiveBlurFilter: 高斯模糊,将焦点保留在一个圆形区域内。
-
blurRadiusInPixels
: 用于模糊半径(以像素为单位),默认值为5.0
。这会调整高斯分布函数(distribution function)中的sigma
变量。 -
excludeCircleRadius
: 未模糊的圆形区域的半径,范围(0, 1)
。 -
excludeCirclePoint
: 未模糊的圆形区域的中心点,范围(0, 1)
,都是以图片大小为基点。 -
excludeBlurSize
: 模糊区域和未模糊的圆形区域之间的区域的宽,大小范围(0, 1)
。 -
aspectRatio
: 图像的宽高比,用于调整对焦区域的椭圆度。 默认等于图像宽高比,但您可以修改此值。
-
-
GPUImageGaussianBlurPositionFilter: 基于
GPUImageGaussianSelectiveBlurFilter
做的修改, 仅对某个确定的圆形区域进行模糊。-
blurSize: A multiplier for the size of the blur (模糊区域的size), 从
0
开始增加, 默认为1
。 -
blurCenter: 模糊的中心点, 默认
(0.5, 0.5)
。 -
blurRadius: 模糊半径, 默认
1.0
。
-
blurSize: A multiplier for the size of the blur (模糊区域的size), 从
-
GPUImageiOSBlurFilter: iOS系统风格的模糊,像iOS控制中心的模糊一样。
-
blurRadiusInPixels
: 用于模糊半径(以像素为单位),默认值为12
。这会调整高斯分布函数(distribution function)中的sigma
变量。 -
saturation
: 饱和度,范围从0
(fully desaturated) 到2.0
(max saturation), 正常值为0.8
。 -
downsampling
: The degree to which to downsample, then upsample the incoming image to minimize computations within the Gaussian blur, with a default of 4.0.
-
GPUImageMedianFilter: 采用三个颜色分量的中值,超过3x3区域。(Takes the median value of the three color components, over a 3x3 area)
-
GPUImageBilateralFilter: 双边滤波模糊 (可用于磨皮),模糊相似的颜色值,同时保留锐边。(A bilateral blur, which tries to blur similar color values while preserving sharp edges)
-
texelSpacingMultiplier
: A multiplier for the spacing between texel reads, ranging from 0.0 on up, with a default of 4.0 -
distanceNormalizationFactor
: A normalization factor for the distance between central color and sample color, with a default of 8.0.
-
-
GPUImageTiltShiftFilter: A simulated tilt shift lens effect
- blurRadiusInPixels: The radius of the underlying blur, in pixels. This is 7.0 by default.
- topFocusLevel: The normalized location of the top of the in-focus area in the image, this value should be lower than bottomFocusLevel, default 0.4
- bottomFocusLevel: The normalized location of the bottom of the in-focus area in the image, this value should be higher than topFocusLevel, default 0.6
- focusFallOffRate: The rate at which the image gets blurry away from the in-focus region, default 0.2
-
GPUImage3x3ConvolutionFilter: Runs a 3x3 convolution kernel against the image
- convolutionKernel: The convolution kernel is a 3x3 matrix of values to apply to the pixel and its 8 surrounding pixels. The matrix is specified in row-major order, with the top left pixel being one.one and the bottom right three.three. If the values in the matrix don't add up to 1.0, the image could be brightened or darkened.
-
GPUImageSobelEdgeDetectionFilter: Sobel edge detection, with edges highlighted in white
- texelWidth:
- texelHeight: These parameters affect the visibility of the detected edges
- edgeStrength: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0.
-
GPUImagePrewittEdgeDetectionFilter: Prewitt edge detection, with edges highlighted in white
- texelWidth:
- texelHeight: These parameters affect the visibility of the detected edges
- edgeStrength: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0.
-
GPUImageThresholdEdgeDetectionFilter: Performs Sobel edge detection, but applies a threshold instead of giving gradual strength values
- texelWidth:
- texelHeight: These parameters affect the visibility of the detected edges
- edgeStrength: Adjusts the dynamic range of the filter. Higher values lead to stronger edges, but can saturate the intensity colorspace. Default is 1.0.
- threshold: Any edge above this threshold will be black, and anything below white. Ranges from 0.0 to 1.0, with 0.8 as the default
-
GPUImageCannyEdgeDetectionFilter: This uses the full Canny process to highlight one-pixel-wide edges
- texelWidth:
- texelHeight: These parameters affect the visibility of the detected edges
- blurRadiusInPixels: The underlying blur radius for the Gaussian blur. Default is 2.0.
- blurTexelSpacingMultiplier: The underlying blur texel spacing multiplier. Default is 1.0.
- upperThreshold: Any edge with a gradient magnitude above this threshold will pass and show up in the final result. Default is 0.4.
- lowerThreshold: Any edge with a gradient magnitude below this threshold will fail and be removed from the final result. Default is 0.1.
-
GPUImageHarrisCornerDetectionFilter: Runs the Harris corner detection algorithm on an input image, and produces an image with those corner points as white pixels and everything else black. The cornersDetectedBlock can be set, and you will be provided with a list of corners (in normalized 0..1 X, Y coordinates) within that callback for whatever additional operations you want to perform.
- blurRadiusInPixels: The radius of the underlying Gaussian blur. The default is 2.0.
- sensitivity: An internal scaling factor applied to adjust the dynamic range of the cornerness maps generated in the filter. The default is 5.0.
- threshold: The threshold at which a point is detected as a corner. This can vary significantly based on the size, lighting conditions, and iOS device camera type, so it might take a little experimentation to get right for your cases. Default is 0.20.
-
GPUImageNobleCornerDetectionFilter: Runs the Noble variant on the Harris corner detector. It behaves as described above for the Harris detector.
- blurRadiusInPixels: The radius of the underlying Gaussian blur. The default is 2.0.
- sensitivity: An internal scaling factor applied to adjust the dynamic range of the cornerness maps generated in the filter. The default is 5.0.
- threshold: The threshold at which a point is detected as a corner. This can vary significantly based on the size, lighting conditions, and iOS device camera type, so it might take a little experimentation to get right for your cases. Default is 0.2.
-
GPUImageShiTomasiCornerDetectionFilter: Runs the Shi-Tomasi feature detector. It behaves as described above for the Harris detector.
- blurRadiusInPixels: The radius of the underlying Gaussian blur. The default is 2.0.
- sensitivity: An internal scaling factor applied to adjust the dynamic range of the cornerness maps generated in the filter. The default is 1.5.
- threshold: The threshold at which a point is detected as a corner. This can vary significantly based on the size, lighting conditions, and iOS device camera type, so it might take a little experimentation to get right for your cases. Default is 0.2.
GPUImageNonMaximumSuppressionFilter: Currently used only as part of the Harris corner detection filter, this will sample a 1-pixel box around each pixel and determine if the center pixel's red channel is the maximum in that area. If it is, it stays. If not, it is set to 0 for all color components.
GPUImageXYDerivativeFilter: An internal component within the Harris corner detection filter, this calculates the squared difference between the pixels to the left and right of this one, the squared difference of the pixels above and below this one, and the product of those two differences.
-
GPUImageCrosshairGenerator: This draws a series of crosshairs on an image, most often used for identifying machine vision features. It does not take in a standard image like other filters, but a series of points in its -renderCrosshairsFromArray:count: method, which does the actual drawing. You will need to force this filter to render at the particular output size you need.
- crosshairWidth: The width, in pixels, of the crosshairs to be drawn onscreen.
GPUImageDilationFilter: This performs an image dilation operation, where the maximum intensity of the red channel in a rectangular neighborhood is used for the intensity of this pixel. The radius of the rectangular area to sample over is specified on initialization, with a range of 1-4 pixels. This is intended for use with grayscale images, and it expands bright regions.
GPUImageRGBDilationFilter: This is the same as the GPUImageDilationFilter, except that this acts on all color channels, not just the red channel.
GPUImageErosionFilter: This performs an image erosion operation, where the minimum intensity of the red channel in a rectangular neighborhood is used for the intensity of this pixel. The radius of the rectangular area to sample over is specified on initialization, with a range of 1-4 pixels. This is intended for use with grayscale images, and it expands dark regions.
GPUImageRGBErosionFilter: This is the same as the GPUImageErosionFilter, except that this acts on all color channels, not just the red channel.
GPUImageOpeningFilter: This performs an erosion on the red channel of an image, followed by a dilation of the same radius. The radius is set on initialization, with a range of 1-4 pixels. This filters out smaller bright regions.
GPUImageRGBOpeningFilter: This is the same as the GPUImageOpeningFilter, except that this acts on all color channels, not just the red channel.
GPUImageClosingFilter: This performs a dilation on the red channel of an image, followed by an erosion of the same radius. The radius is set on initialization, with a range of 1-4 pixels. This filters out smaller dark regions.
GPUImageRGBClosingFilter: This is the same as the GPUImageClosingFilter, except that this acts on all color channels, not just the red channel.
GPUImageLocalBinaryPatternFilter: This performs a comparison of intensity of the red channel of the 8 surrounding pixels and that of the central one, encoding the comparison results in a bit string that becomes this pixel intensity. The least-significant bit is the top-right comparison, going counterclockwise to end at the right comparison as the most significant bit.
-
GPUImageLowPassFilter: This applies a low pass filter to incoming video frames. This basically accumulates a weighted rolling average of previous frames with the current ones as they come in. This can be used to denoise video, add motion blur, or be used to create a high pass filter.
- filterStrength: This controls the degree by which the previous accumulated frames are blended with the current one. This ranges from 0.0 to 1.0, with a default of 0.5.
-
GPUImageHighPassFilter: This applies a high pass filter to incoming video frames. This is the inverse of the low pass filter, showing the difference between the current frame and the weighted rolling average of previous ones. This is most useful for motion detection.
- filterStrength: This controls the degree by which the previous accumulated frames are blended and then subtracted from the current one. This ranges from 0.0 to 1.0, with a default of 0.5.
-
GPUImageMotionDetector: This is a motion detector based on a high-pass filter. You set the motionDetectionBlock and on every incoming frame it will give you the centroid of any detected movement in the scene (in normalized X,Y coordinates) as well as an intensity of motion for the scene.
- lowPassFilterStrength: This controls the strength of the low pass filter used behind the scenes to establish the baseline that incoming frames are compared with. This ranges from 0.0 to 1.0, with a default of 0.5.
-
GPUImageHoughTransformLineDetector: Detects lines in the image using a Hough transform into parallel coordinate space. This approach is based entirely on the PC lines process developed by the Graph@FIT research group at the Brno University of Technology and described in their publications: M. Dubská, J. Havel, and A. Herout. Real-Time Detection of Lines using Parallel Coordinates and OpenGL. Proceedings of SCCG 2011, Bratislava, SK, p. 7 (http://medusa.fit.vutbr.cz/public/data/papers/2011-SCCG-Dubska-Real-Time-Line-Detection-Using-PC-and-OpenGL.pdf) and M. Dubská, J. Havel, and A. Herout. PClines — Line detection using parallel coordinates. 2011 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), p. 1489- 1494 (http://medusa.fit.vutbr.cz/public/data/papers/2011-CVPR-Dubska-PClines.pdf).
- edgeThreshold: A threshold value for which a point is detected as belonging to an edge for determining lines. Default is 0.9.
- lineDetectionThreshold: A threshold value for which a local maximum is detected as belonging to a line in parallel coordinate space. Default is 0.20.
- linesDetectedBlock: This block is called on the detection of lines, usually on every processed frame. A C array containing normalized slopes and intercepts in m, b pairs (y=mx+b) is passed in, along with a count of the number of lines detected and the current timestamp of the video frame.
-
GPUImageLineGenerator: A helper class that generates lines which can overlay the scene. The color of these lines can be adjusted using -setLineColorRed:green:blue:
- lineWidth: The width of the lines, in pixels, with a default of 1.0.
-
GPUImageMotionBlurFilter: Applies a directional motion blur to an image
- blurSize: A multiplier for the blur size, ranging from 0.0 on up, with a default of 1.0
- blurAngle: The angular direction of the blur, in degrees. 0 degrees by default.
-
GPUImageZoomBlurFilter: Applies a directional motion blur to an image
- blurSize: A multiplier for the blur size, ranging from 0.0 on up, with a default of 1.0
- blurCenter: The normalized center of the blur. (0.5, 0.5) by default