1IM_STDIF(3) Library Functions Manual IM_STDIF(3)
2
3
4
6 im_stdif, im_stdif_raw - statistical differentiation of an image
7
9 #include <vips/vips.h>
10
11 int im_stdif(in, out, a, m0, b, s0, xw, yw)
12 IMAGE *in, *out;
13 double a, m0, b, s0;
14 int xw, yw;
15
16 int im_stdif_raw(in, out, a, m0, b, s0, xw, yw)
17 IMAGE *in, *out;
18 double a, m0, b, s0;
19 int xw, yw;
20
21
23 im_stdif() preforms statistical differencing according to the formula
24 given in page 45 of the book "An Introduction to Digital Image Process‐
25 ing" by Wayne Niblack. This transformation emphasises the way in which
26 a pel differs statistically from its neighbours. It is useful for
27 enhancing low-contrast images with lots of detail, such as X-ray
28 plates.
29
30 At point (i,j) the output is given by the eqn:
31
32 vout(i,j) = a*m0 + (1-a)*meanv +
33 (vin(i,j) - meanv) * (b*s0) / (s0+b*stdv)
34
35 Values a, m0, b and s0 are entered, while meanv and stdv are the values
36 calculated over a moving window of size xw, yw centred on pixel (i,j).
37 m0 is the new mean, a is the weight given to it. s0 is the new standard
38 deviation, b is the weight given to it. Try:
39
40 im_stdif $VIPSHOME/pics/huysum.v fred.v 0.5 128 0.5 50 11 11
41
42 The opreation works on one-band UCHAR images only, and writes a one-
43 band UCHAR image as its result. The output image has the same size as
44 the input - a black border is added to mark uncomputable pixels.
45
46 im_stdif_raw() behaves exactly as im_stdif(), but does not add the bor‐
47 der of black pixels.
48
49
51 All functions returns 0 on success and -1 on error.
52
54 im_lhisteq(3), im_histgr(3), im_hsp(3), im_heq(3).
55
57 1991-1996, The National Gallery and Birkbeck College
58
59
60
61 10 May 1991 IM_STDIF(3)