---
name: "im_match_linear"
section: "3"
platform: "linux"
package: "libvips-dev"
version: "7.20.7-1+b3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/im_match_linear_search"
---

# im\_match\_linear(3)

resample to make a match

Part of [im\_match\_linear\_search(3)](/im_match_linear_search/3.md).

## NAME

im\_match\_linear\_search, im\_match\_linear - resample to make a match

## SYNOPSIS

\#include \<vips/vips.h\>

int\
 im\_match\_linear( IMAGE \*ref, IMAGE \*sec, IMAGE \*out,\
\
    int xr1, int yr1, int xs1, int ys1, \
\
    int xr2, int yr2, int xs2, int ys2 )

int\
 im\_match\_linear\_search( IMAGE \*ref, IMAGE \*sec, IMAGE \*out,\
\
    int xr1, int yr1, int xs1, int ys1, \
\
    int xr2, int yr2, int xs2, int ys2,\
\
    int hwindowsize, int hsearchsize )

## DESCRIPTION

im\_match\_linear\_search() attempts to transform sec to make it match ref. The transformation is linear, that is, it only involves scale, rotate and translate.

im\_match\_linear\_search() requires a pair of tie points to fix the parameters of  its transformation. You should pick points as far apart as possible to  increase accuracy. im\_match\_linear\_search() will search the area in the image  around each tie point for a good fit, so your selection of points need not  be exact. WARNING! This searching process will fail for rotations of more  than about 10 degrees or for scales of more than about 10 percent. The best you can hope for is \< 1 pixel error, since the command does not  attempt sub-pixel correlation.

hwindowsize and hsearchsize set the size of the area to be searched: we recommend values of 5 and 14.

The output image is positioned and clipped so that you can immediately  subtract it from orig to obtain pixel difference images.

im\_match\_linear() works exactly as im\_match\_linear\_search(), but does not attempt to correlate to correct your tie points. It can thus be used for any angle and any scale, but you must be far more careful in your selection.

## SEE ALSO

im\_lrmosaic().

## AUTHORS

J.Ph.Laurent - 12/12/92\
 J.Cupitt - 22/02/93
