Thinning method of an image

Abstract: It is a purpose for this invention to provide a thinning method for an image for obtaining a resultant image of one pixel width without removing a figure having a line changing the width from 3 pixels to 2 pixels. When this invention defines an index pixel value of unused value in the image, the objective pixel is preserved as it is in the condition that a pixel on one previous scan line along the scan line and to which the pixel corresponding to the objective pixel follows along the scan line is the index pixel, and a pixel on latter scan line and which the pixel corresponding to said objective pixel is in front of along the scan line is the background pixel.

Description: The invention relates to an image processing method for thinning an object according to the preamble part of claim 1. Such a method is known from EP-A-0 375 806. In the microscopic image of a metal crystal, the crystal interface appears as a line having a width of more than one pixel. It is impossible to measure correctly the particle size without transforming this boundary line into a line having a width of one pixel and being positioned in the middle of the original boundary line. Consequently, it is necessary to transform the original boundary line to a line of one pixel width at the center of the original boundary line. This process is called thinning. Thinning must not interrupt the original boundary lines, which would fuse adjacent crystals into each other. It is impossible to measure particles like crystals accurately when the boundary line is interrupted. For preventing wrong measurements, the thinning process has to meet the following demands: 1) The width of a thinned line is one pixel; 2) The thinned line is substantially positioned at the center of the original boundary line; 3) Continuity of the original boundary lines is preserved; 4) An end part of a thinned line is not shortened; 5) Thinning does not generate a spike-like line if a boundary part is uneven; and 6) Boundary lines are not deformed when they intercept each other. The demands 1) to 4) are called basic conditions of thinning, which an algorithm must satisfy first. Such an algorithm is described in "Image Processing on a Personal Computer", by Hasegawa, Junichi, published by Gijutsuhyoronsha, pages 66 and 67, 1996. A further known thinning method is called HILDITCH's method. Its performance has been thoroughly investigated. It turned out that the processing speed of Hilditch's method is not high enough because Hilditch's method counts not only the number of the connectedness of the objective pixels but also the number of the background pixels. In order to increase the processing speed, an image processing method was proposed in JP 64-13680. However, this method completely lost a boundary line, when the width of the boundary line changed from three pixels to two pixels (figure 1). In order to overcome this problem EP-A-0 375 806 discloses a thinning method which distinguishes between parallel processing and sequential processing. Parallel processing means that in each process cycle the neighbour pixels around the pixel to be processed are evaluated on the basis of their values before that processing cycle. In contrast thereto, sequential processing means that each pixel is evaluated on the basis of its value in that processing cycle. In order to distinguish between parallel and sequential processing, an index value of, for example, -1 is assigned to a pixel which is processed according to parallel processing. This document teaches the processing rules discussed in connection with figures 3 to 5 and 7 and 8. It is the object of the invention to solve the conventional problems and in particular to avoid that a surface boundary is interrupted when its width changes from three pixels to two pixels. This object is solved by the image processing method of claim 1. In the following, a preferred embodiment of the invention is described referring to the accompanying drawings. Figure 1 shows a diagram before performing thinning. Figure 2 shows a diagram after thinning the diagram of Figure 1. Figure 3 shows a diagram elucidating the judgment condition [1]. Figure 4 shows a diagram elucidating the judgment condition [2]. Figure 5 shows a diagram elucidating the judgment condition [3]. Figure 6 shows a diagram elucidating the judgment condition [4]. Figure 7 shows a diagram elucidating the judgment condition [5]. Figure 8 shows a diagram elucidating the judgment condition [6]. An embodiment in a thinning method of an image according to the present invention is explained, referring to the attached drawings. A general scan from the left to the right and from the top to the bottom is adopted in the embodiment. This invention determines beforehand the value of a pixel which is not the value of a processing object but is a background pixel value instead (for example "0"). When a pixel is neither an end point nor an independent point in parallel processing, has connectedness in sequential processing, and is a boundary pixel in parallel processing, the value of this pixel is changed to the background pixel value in order to convert a figure that does not have a background pixel value in the image into a line with a width of one pixel preserving characteristics of the figure of the configuration. A non-existing index pixel value is defined as an index pixel value in the image (non-existing pixel value in the image, for example "-1") and a pixel is picked up in the image as an objective pixel "A" at successive scanning. The value of the objective pixel "A" is changed to a background pixel value when the objective pixel "A" has an index pixel value, and the conditions below are adopted in 3 x 3 convolution when the objective pixel "A" does not have a background pixel value nor an index pixel value. [1] When the pixels above and left of the objective pixel "A" have a background pixel value, the objective pixel "A" is given an index pixel value (e.g.-1) different from a general pixel value (Fig. 3). [2] In the case where the condition does not meet condition [1]. in sequential processing, when the pixel "C" above the objective pixel "A" has an index pixel value (e.g. -1) and when the pixel "B" beneath it has a background pixel value, the value of the objective pixel "A" is not changed (Fig. 4). [3] If condition [1] is not fulfilled, in sequential processing, when the pixel "C" left of an objective pixel "A" has an index pixel value and when pixel "B" right of an objective pixel "A" has a background pixel value, the objective pixel value "A" remains unchanged (Fig. 5). [4] If condition [1] is not fulfilled, in sequential processing, when objective pixel "C" on the upper left of an objective pixel "A" has an index pixel value and pixel "B" beneath the lower right of objective pixel "A" has a background pixel value, the objective pixel "A" is preserved as it is (Fig. 6). [5] If conditions [1] to [4] are not fulfilled, in sequential processing, when the pixel "B" above the objective pixel "A" has an index pixel value, and when in parallel processing, the pixels "C1" and "C2" left and right of pixel "B" have background pixel values, the value of the objective pixel "A" is set to the index pixel value (Fig. 7). [6] If conditions [1] to [4] are not fulfilled, in sequential processing, if pixel "B" left of pixel "A" has an index pixel value and pixel "C1" above pixel "B" and pixel "C2" below pixel "B" have background pixel values, objective pixel "A" is set to the index pixel value (Fig. 8). The parallel processing judges that a pixel value changed just on the scanning does not change yet. and the successive processing evaluates the pixel value after the change with respect to the pixel whose pixel value is changed by a scan. And the pixel with the index pixel value generated by these processing is changed its pixel value to a background pixel value by the next scan. The method of this invention is performed on a line having a width ranging from 2 to 3 pixels shown in Figure 1. The pixel "A" satisfies the condition [1] and has an index pixel value. Pixel "B", "C", "D" do not satisfy the conditions from [1] to [6] and are set to background pixel values. Pixel "E" satisfies the case [4] (Fig.6) and therefore its value is preserved. Pixel "F" does not satisfy the cases from [1] to [6] and is set to the background pixel value. As pixel "F" changes its value to a background pixel value, pixel "G" has 2-connectedness in sequential processing and is to be preserved. Pixel "H" does not satisfy the cases from [1] to [6] and is set to the background pixel value. By pixel "H" being set to a background pixel value, the pixel "I" has 2-connectedness in sequential processing and is to be preserved. Pixel "J" does not satisfy the cases from [1] to [6] and is set to the background pixel value. Pixel "J" having a background pixel value, pixel "K" has 2-connectedness in sequential processing and is to be preserved. Pixel "L" and "M" do not satisfy the cases from [1] to [6] and their values are set to be the background pixel value. As a result of this thinning processing, the line in Fig. 1 is transformed to a thinned line shown in Fig. 2. According to this invention as mentioned above, a figure having a line whose width changes from 3 pixels to 2 pixels along the parallel direction of the scan line can be thinned into a line of one pixel width without seriously slowing down processing.

Claims: An image processing method for thinning an object in an image comprised of pixels, each pixel having a value signifying that said pixel either belongs to the background or to an object, or having an index value, said pixels are successively scanned along scan lines thereby changing the value of a current pixel in a current line encountered during scanning according to the following thinning rules: A) changing the value of said current pixel to said background value, if said current pixel has said index value; B) changing the value of said current pixel according to rules B1 to B3, if said current pixel has said object value and is a border pixel but not an end pixel, wherein said end pixel is defined in that just one of its 8 nearest neighbours has said object value: B1) changing the value of said current pixel into said index value, if the preceding pixel in said current line and the corresponding pixel in the preceding line have said background value (figure 3); B2) preserving the value of said current pixel, if said current pixel has not already been processed by rule B1, and if one of the conditions B2a and B2b is fulfilled: B2a) the pixel in the preceding line corresponding to said current pixel has said index value and the pixel positioned in the subsequent line corresponding to said current pixel has said background value (figure 4), or B2b) the pixel preceding to said current pixel in said current line has said index value and the pixel subsequent to said current pixel in said current line has said background value (figure 5); B3) changing the value of said current pixel to said index value, if said current pixel has not already been processed by one of the above rules B1 and B2 and if one of the following conditions B3a or B3b are fulfilled: B3a) the pixel in the preceding line corresponding to said current pixel has said index value and the preceding pixel and the subsequent pixel of said corresponding pixel in the preceding scan line have said background value (figure 7), or B3b) the preceding pixel of said current pixel in said current line has said index value and the pixels in the preceding and subsequent line corresponding to said preceding pixel have said background value (figure 8); characterized in that in rule B2 the value of said current pixel is also preserved, if the pixel preceding of the corresponding pixel of said current pixel in said preceding scan line has said index value and the pixel subsequent to the corresponding pixel of said current pixel in the subsequent scan line has said background value (figure 6).

Inventors: KUMAGAI RYOHEI, KUMAGAI, RYOHEI, KUMAGAI, RYOHEI, C/O EZEL INC.
Applicants: YOZAN INC, YOZAN INC.
Application year: 1993
Main classification: G06T5
IPC codes: G06T5