A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://libvips.github.io/libvips/API/current/method.Image.find_trim.html below:

Vips.Image.find_trim

Method VipsImagefind_trim Declaration [src]
int
vips_find_trim (
  VipsImage* in,
  int* left,
  int* top,
  int* width,
  int* height,
  ...
)
Description [src]

Search in for the bounding box of the non-background area.

Any alpha is flattened out, then the image is median-filtered (unless line_art is set, see below). The absolute difference from background is computed and binarized according to threshold. Row and column sums of the absolute difference are calculated from this binary image and searched for the first row or column in each direction to obtain the bounding box.

If the image is entirely background, vips_find_trim() returns width == 0 and height == 0.

background defaults to 255, or 65535 for 16-bit images. Set another value, or use vips_getpoint() to pick a value from an edge. You’ll need to flatten before vips_getpoint() to get a correct background value.

threshold defaults to 10.

The detector is designed for photographic or compressed images where there is a degree of noise that needs filtering. If your images are synthetic (eg. rendered from vector art, perhaps), set line_art to disable this filtering.

The image needs to be at least 3x3 pixels in size.

Optional arguments

This method is not directly available to language bindings.

Parameters
left

Type: int*

Output left edge.

The argument will be set by the function.
top

Type: int*

Output top edge.

The argument will be set by the function.
width

Type: int*

Output width.

The argument will be set by the function.
height

Type: int*

Output height.

The argument will be set by the function.
...

Type: 

NULL-terminated list of optional named arguments.

Return value

Type: int

0 on success, -1 on error.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4