The present invention relates to methods for processing an image so as to classify pixels of the image based on an intensity threshold. In particular, the invention relates to such a method having an improved process for selection of the threshold. The invention is applicable to both medical and non-medical images.
Binarisation is a well-known technique for image segmentation—that is classifying pixels of the image into two classes. Binarisation performs this classification based on whether a given pixel of the image has an intensity (gray-level) above or below a threshold. Binarisation has been widely applied to a number of image processing and computer vision applications, as a preliminary segmentation step. It makes an implicit assumption that an object of interest in the image has different intensity values from other (background) portions of the image.
Many techniques exist for selection of the threshold. For example, in some such processes, the threshold can be selected in a process involving user interaction, while in other processes the threshold is selected entirely automatically. In some such processes the threshold is selected locally (i.e. such that the threshold varies from one pixel to another), while in other processes the threshold is the same over the whole image.
Most automatic threshold selection methods employ a histogram of the gray levels in the image. For example, Otsu [1] proposed a selection of the threshold to maximise the separability of the resultant classes in gray levels, which is performed by minimising the within-class variance. Li and Lee [2] selected the threshold by minimising the cross entropy between the image and its segmented version. Kittler and lllingworth [3] selected the threshold by minimising the Bayes errors under the assumption that the object and pixel gray level values are normally distributed. Kapur et al [4] provided a maximum entropy approach. Wong and Sahoo [5] maximised the entropy with constraints on the region homogeneity and object boundary. Saha and Udupa [6] proposed a technique which maximised class uncertainty and homogeneity of the regions. Cheng et al [7] used the concept of fuzzy c-partition and the maximum fuzzy entropy principle to select a threshold.
Cheung at al (U.S. Pat. No. 5,231,580A, 1993) disclosed an automatic method to characterise nerve fibres using local thresholds. It first partitions the entire image into sub-images and finds the threshold for each sub-image using a histogram-based thresholding method. Then, the pixel-wise threshold is approximated by interpolating the thresholds of neighbouring subimages.
It is observed that the existing methods for selecting a threshold described above lack a mechanism for incorporating prior knowledge about the images to be binarised.
Thus, the present invention aims to provide a new and useful technique for selecting a threshold for binarising an image, and in particular one which enables prior knowledge to be explicitly incorporated.
In general terms, the invention proposes firstly that this prior knowledge is used to define a region of interest (ROI) in the image, such that the analysis of frequency distribution of pixel intensities (represented by a frequency histogram) is performed only for pixels in the ROI. Secondly, the invention proposes that the prior knowledge is used to select an intensity range, and that only pixels within this intensity range are used to generate the frequency distribution from which the threshold is selected.
These two ideas are in principle separate, but in combination they provide a highly effective mechanism for incorporating prior knowledge into the threshold selection. The advantage is critical whether the image is a medical one or not. In particular, a threshold can be found to binarise images which exhibits high robustness to imaging artefacts such as gray level inhomogeneity and noise.
Specifically, one expression of the invention is a method of binarising an image composed of pixels having respective intensity values, the method comprising:
The invention may alternatively be expressed as a computer system which is set up to perform such a method. Alternatively, it can be expressed as software for performing the method.
Preferred features of the invention will now be described, for the sake of illustration only, with reference to the following figures in which:
Referring firstly to
In step 1, an image is input.
In step 2, prior knowledge of the image is used to define a region of interest (ROI) which is a subset of the image. This process can be done by whatever means, either automatic, semi-automatic, or even manual.
In step 3 an analysis is performed on the frequency of occurrence of intensities within the ROI, and a range of frequencies is defined, again using prior knowledge.
For example, without losing generality, we denote the image to be processed as f(x), where f(x) is the gray level at a pixel labelled x. It is further supposed that the processed image has L gray levels denoted by ri where i is an integer in the range 0 to L-1 and r0<r1< . . . rL-1. It is also assumed that the object of interest has higher intensity values than the background. Suppose that due to prior knowledge or test we know that the proportion of the region of interest which is occupied by the object is in the percentage range per0 to per1.
Let h(i) denote the frequency of gray level ri, and let H(i) denote the cumulative frequency which is
where i′ is an integer dummy index. Considering two values of i written as m and n, the frequency of intensities in the range rm to rn is
Thus, we can use per0 to calculate a gray level rlow, such that we are sure that all the pixels having lower intensity represent background. rlow can be written as:
Similarly, we can use per1 to calculate a gray level rhigh such that we are sure that all pixels having higher intensity represent the object:
In a step 4 of the method of
Image binarisation is then performed using this threshold, to create an image in which all pixels (at least in the ROI) are classified into two classes. Further image processing steps may optionally be performed at this stage.
We now turn to a discussion of three techniques by which step 4 can be carried out.
1. Range-constrained Least Valley Detection Method (RCLVD)
If the frequency range derived in step 3 is correctly estimated then it will include a valley in the frequency distribution of intensities. This valley separates the background and the object. Thus, valley detection can be exploited to select the threshold. This has the following steps:
1) A frequency interval δh is specified.
2) The gray level range [rlow, rhigh] is partitioned into K+1 intervals with an equal frequency range δh. For an interval labelled by integer index j, the lower end of its intensity range is denoted r1j and the upper end is denoted r2j. Thus:
3) The average frequency
4) Let J denote the interval for which
2. Range-constrained Weighted Variance Method (RCWV)
Let rk fall within the range rlow to rhigh, and suppose that the pixels of the ROI are in two classes C1 and C2, where C1 is pixels of the background class and consists of pixels with gray levels rlow to rk, and C2 is pixels of the object class and is composed of pixels with gray levels rk+1 to rhigh. The range-constrained weighted variance method maximises the “weighted between-class variance” defined as:
where W1 and W2 are two positive constants selected by the user and representing the weights of the two respective class variances, Pr(.) denotes the class probability, i.e.
and D(C1) and D(C2) are given by:
When W1 is bigger than W2, background homogeneity is emphasised.
3. Range-constrained Fuzzy C-partition Thresholding Method (RCFCP)
This third method is related to the technique used in [7], and the justification for it is as given there. In general terms, let Ab/A0 be the fuzzy sets of fuzzy events “background/object” (which denotes a fuzzy partition of the set {rlow, . . . , rhigh with a membership function μA
where Ai∈{Ab,A0, and the weighted entropy with this fuzzy partition can be calculated as:
S(W1,W2)=W1×P(Ab)×log P(Ab)+W2×P(A0)×log P(A0)
where W1 and W2 are two positive constants, and log(.) is the natural logarithm.
Let rlow≦a<c≦rhigh. The membership functions can be defined as follows:
The optimum parameters a* and c* are chosen to maximise the entropy S(W1, W2), and the optimum threshold is θRCFCP=(a*+c*)/2.
Having now presented the steps of the embodiment in principle, we turn to an example of the embodiment in operation. This example uses the form of step 4 referred to above as RCLVD.
The starting point of the method is the image shown in
In step 2 of the method, we calculate the pixels enclosed by the skull (i.e. find the ROI) using the following steps: the usual histogram-based thresholding method is used to binarise the axial slice; a morphological closing operation is used to connect small gaps; the largest connected component is identified; and the holes within the component are filled. The resulting ROI (the pixels enclosed by the skull) is shown in
In step 3, the two percentages pero and per, are set as 14% and 28%. This selection is based on previous experiments and/or other prior knowledge.
In step 4 of the method (RCLVD), we select the δh to be 1% (alternatively any value in the range 1% to 5% would be suitable).
The output threshold of the method is used as in conventional techniques to binarise the image. The binarised image is shown in
Although only a single embodiment of the invention has been described, many variations are possible within the scope of the invention as will be clear to a skilled reader.
The disclosure of the following references is incorporated herein by reference in their entirety:
Number | Date | Country | Kind |
---|---|---|---|
200307531-4 | Dec 2003 | SG | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/SG04/00403 | 12/9/2004 | WO | 6/9/2006 |