Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/share/gtk-doc/html/libvips/ drwxr-xr-x | |
| Viewing file: Select action/file-type:
Functions
DescriptionThe morphological functions search images for particular patterns of pixels, specified with the mask argument, either adding or removing pixels when they find a match. They are useful for cleaning up images --- for example, you might threshold an image, and then use one of the morphological functions to remove all single isolated pixels from the result. If you combine the morphological operators with the mask rotators
( Beware that VIPS reverses the usual image processing convention, by assuming white objects (non-zero pixels) on a black background (zero pixels). The mask you give to the morphological functions should contain only the values 0 (for background), 128 (for don't care) and 255 (for object). The mask must have odd length sides --- the origin of the mask is taken to be the centre value. For example, the mask: 3 3 128 255 128 255 0 255 128 255 128 applied to an image with See Functionsvips_morph ()int vips_morph ( Performs a morphological operation on The image should have 0 (black) for no object and 255 (non-zero) for an object. Note that this is the reverse of the usual convention for these operations, but more convenient when combined with the boolean operators. The output image is the same size as the input image: edge pxels are made by expanding the input image as necessary. Mask coefficients can be either 0 (for object) or 255 (for background) or 128 (for do not care). The origin of the mask is at location (m.xsize / 2, m.ysize / 2), integer division. All algorithms have been based on the book "Fundamentals of Digital Image Processing" by A. Jain, pp 384-388, Prentice-Hall, 1989. For VIPS_OPERATION_MORPHOLOGY_ERODE, the whole mask must match for the output pixel to be set, that is, the result is the logical AND of the selected input pixels. For VIPS_OPERATION_MORPHOLOGY_DILATE, the output pixel is set if any part of the mask matches, that is, the result is the logical OR of the selected input pixels. See the boolean operations Operations are performed using the processor's vector unit, if possible. Disable this with --vips-novector or IM_NOVECTOR. [method] vips_rank ()int vips_rank ( vips_rank() does rank filtering on an image. A window of size It works for any non-complex image type, with any number of bands. The input is expanded by copying edge pixels before performing the operation so that the output image has the same size as the input. Edge pixels in the output image are therefore only approximate. For a median filter with mask size m (3 for 3x3, 5 for 5x5, etc.) use vips_rank( in, out, m, m, m * m / 2 ); The special cases n == 0 and n == m * m - 1 are useful dilate and expand operators. See also: [method] vips_median ()int vips_median ( A convenience function equivalent to: vips_rank( in, out, size, size, (size * size) / 2 ); See also: [method] vips_countlines ()int vips_countlines ( Function which calculates the number of transitions between black and white for the horizontal or the vertical direction of an image. black<128 , white>=128 The function calculates the number of transitions for all Xsize or Ysize and returns the mean of the result Input should be one band, 8-bit. See also: [method] vips_labelregions ()int vips_labelregions ( Optional arguments:
Repeatedly scans
This operation is useful for, for example, blob counting. You can use the
morphological operators to detect and isolate a series of objects, then use
Use See also: [method] vips_fill_nearest ()int vips_fill_nearest ( Optional arguments:
Fill outwards from every non-zero pixel in At the position of zero pixels in
See also: [method] |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.005 ]-- |