圖片處理 (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: 硬件優(yōu)化的七蜘、半徑可變的高斯模糊(Gaussian blur)。
-
texelSpacingMultiplier
: 紋理元素間距的乘數(shù)(A multiplier for the spacing between texels), 范圍從0
開始,默認是1.0
。提高該參數(shù)會增加模糊強度,但會在結(jié)果中引入偽影(artifacts)卜范。 強烈建議接觸該參數(shù)前,先使用其他參數(shù)。 -
blurRadiusInPixels
: 用于模糊的半徑(以像素為單位)迁匠,默認值為2.0
。這會調(diào)整高斯分布函數(shù)(distribution function)中的sigma變量驹溃。 -
blurRadiusAsFractionOfImageWidth
: -
blurRadiusAsFractionOfImageHeight
: 設(shè)置這些屬性將允許模糊半徑隨圖像的大小縮放城丧。 這些屬性是互斥的(mutually exclusive); 設(shè)置其中任意一個將會使另一個置為0。(Setting these properties will allow the blur radius to scale with the size of the image.) -
blurPasses
: 模糊次數(shù)豌鹤。 值越大亡哄,過濾器(filter)越慢。
-
-
GPUImageBoxBlurFilter: 硬件優(yōu)化的布疙、半徑可變的方框模糊(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
灵临。這會調(diào)整高斯分布函數(shù)(distribution function)中的sigma
變量截型。 -
blurRadiusAsFractionOfImageWidth
: -
blurRadiusAsFractionOfImageHeight
: Setting these properties will allow the blur radius to scale with the size of the image -
blurPasses
: 模糊次數(shù)。值越大儒溉,模糊的越慢宦焦。
-
-
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
。這會調(diào)整高斯分布函數(shù)(distribution function)中的sigma
變量涛碑。 -
blurRadiusAsFractionOfImageWidth
: -
blurRadiusAsFractionOfImageHeight
: Setting these properties will allow the blur radius to scale with the size of the image -
blurPasses
: 模糊次數(shù)精堕。值越大,模糊的越慢锌唾。
-
-
GPUImageGaussianSelectiveBlurFilter: 高斯模糊锄码,將焦點保留在一個圓形區(qū)域內(nèi)夺英。
-
blurRadiusInPixels
: 用于模糊半徑(以像素為單位),默認值為5.0
滋捶。這會調(diào)整高斯分布函數(shù)(distribution function)中的sigma
變量痛悯。 -
excludeCircleRadius
: 未模糊的圓形區(qū)域的半徑,范圍(0, 1)
重窟。 -
excludeCirclePoint
: 未模糊的圓形區(qū)域的中心點载萌,范圍(0, 1)
,都是以圖片大小為基點巡扇。 -
excludeBlurSize
: 模糊區(qū)域和未模糊的圓形區(qū)域之間的區(qū)域的寬扭仁,大小范圍(0, 1)
。 -
aspectRatio
: 圖像的寬高比厅翔,用于調(diào)整對焦區(qū)域的橢圓度乖坠。 默認等于圖像寬高比,但您可以修改此值刀闷。
-
-
GPUImageGaussianBlurPositionFilter: 基于
GPUImageGaussianSelectiveBlurFilter
做的修改, 僅對某個確定的圓形區(qū)域進行模糊熊泵。-
blurSize: A multiplier for the size of the blur (模糊區(qū)域的size), 從
0
開始增加, 默認為1
。 -
blurCenter: 模糊的中心點, 默認
(0.5, 0.5)
甸昏。 -
blurRadius: 模糊半徑, 默認
1.0
顽分。
-
blurSize: A multiplier for the size of the blur (模糊區(qū)域的size), 從
-
GPUImageiOSBlurFilter: iOS系統(tǒng)風(fēng)格的模糊,像iOS控制中心的模糊一樣施蜜。
-
blurRadiusInPixels
: 用于模糊半徑(以像素為單位)卒蘸,默認值為12
。這會調(diào)整高斯分布函數(shù)(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區(qū)域和泌。(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