1LINES(3) Library Functions Manual LINES(3)
2
3
4
6 im_cntlines, im_profile - calculate transitions between black and white
7 pels horizontally or vertically
8
10 #include <vips/vips.h>
11
12 int im_profile(in, out, dir)
13 IMAGE *in, *out;
14 int dir;
15
16 int im_cntlines(in, nolines, dir)
17 IMAGE *in;
18 double *nolines;
19 int dir;
20
21
23 im_profile(3) searches inward from the edge of the image and finds the
24 first non-zero pixel. It outputs an image containing a list of the
25 offsets for each row or column.
26
27 If dir ==0, then im_profile(3) searches down from the top edge, writing
28 an image as wide as the input image, but only 1 pixel high, containing
29 the number of pixels down to the first non-zero pixel for each column
30 of input pixels.
31
32 If dir ==1, then im_profile(3) searches across from the left edge,
33 writing an image as high as the input image, but only 1 pixel wide,
34 containing the number of pixels across to the first non-zero pixel for
35 each row of input pixels.
36
37 im_cntlines(3) calculates the number of transitions between black and
38 white pixels of an image. If dir is 1 then all transitions across the
39 vertical direction are calculated for all Xsize lines of the image. If
40 dir is 0 then all transitions along the horizontal direction for all
41 Ysize lines are calculated. The function returns the number of transi‐
42 tions divided by twice the number of the corresponding Xsize of Ysize
43 lines. The program is primarily used to calculate the number of unbro‐
44 ken horizontal (dir=0) or vertical lines (dir=1) that exist within an
45 image. Input image in can have only one channel.
46
47
49 All functions returns 0 on success and -1 on error.
50
52 im_erode(3), im_dilate(3).
53
54
55
56 14 May 1991 LINES(3)