---
name: "im_measure"
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_measure"
---

# im\_measure(3)

measure colour patches off images

## NAME

im\_measure - measure colour patches off images

## SYNOPSIS

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

DOUBLEMASK \*im\_measure(in, box, h, v, sel, nsel, name)\
 IMAGE \*in;\
 IMAGE\_BOX \*box;\
 int h, v;\
 int \*sel;\
 int nsel;\
 char \*name;

## DESCRIPTION

Analyse a grid of colour patches, producing a DOUBLEMASK of averages. Pass an IMAGE, an IMAGE\_BOX, the number of horizontal and vertical patches, an array giving the numbers of the patches to measure (patches are numbered left-to-right, top-to-bottom, starting with 1) and the name we should give the output mask. Return a DOUBLEMASK in which rows are patches and columns are bands. Only the central 50% of each patch is averaged.

Example: 6 band image of 4x2 block of colour patches.

 \+---+---+---+---+\
  \| 1 \| 2 \| 3 \| 4 \|\
  \+---+---+---+---+\
  \| 5 \| 6 \| 7 \| 8 \|\
  \+---+---+---+---+

Then call im\_measure( im, box, 4, 2, { 2, 4 }, 2, "fred" ) makes a mask "fred" which has 6 columns, two rows. The first row contains the averages for patch 2, the second for patch 4.

Output warnings: a warning is issued if the standard deviation of any patch is greater than 20% of the mean of that patch.

## RETURN VALUE

NULL on error.

## SEE ALSO

[im\_avg(3)](/im_avg/3.md), [im\_deviate(3)](/im_deviate/3.md), [im\_stats(3)](/im_stats/3.md).
