To circumvent this problem, the vessel color features extracted from the RGB channels were normalized to the mean of the local image background. This is adjacent to the vessel diameter (
d), image background depicted in
Figure 1 with the shaded area (flankers
f1 and
f2). For each estimated centerline profile (see
Fig. 1) we calculated the ratio between the mean intensities (
I) falling within the vessel edges (
d) and the mean intensities from the vessel flanks (
f), for example:
where
fij is a vector containing color features for vessel segment
i with centerline pixels
j. Since vessel centerline profiles are estimations of the real intensity information, for reliable local color contrast estimation we require at least three informative pixels in each flank
f and center
d of the estimated profile. Thus for informative color features, only profiles larger than 10 pixels are considered. We then classify vessel color features from each vessel segment
i using the k-means algorithm to find two clusters, with higher intensities for arteries and lower for veins. The k-means method classifies each feature vector into artery or vein first on features calculated from the red channel of the RGB image. The results of this first classification are stored, and then a new set of color features is extracted from the weighted intensities of the red, green, and blue channels such that
where
Idij is the intensity at the
jth vessel segment diameter and
IR,
IB, and
IG are the intensities from the red, green, and blue image channels, respectively. Thus each vessel segment is classified a second time with color features calculated according to
Equation 1 and intensities as specified in
Equation 2. Finally, the classification results are combined to obtain the class of the vessel segment by a voting strategy, which decides the class of the vessel segment based on the prevailing number of color features in it.
6 In other words, a vessel segment is considered a vein when its probability to be a vein is greater than 0.5. For instance, a vessel segment with a higher number of color features classified as belonging to the vein class will be considered a vein and vice versa. When the number of vein and artery features within a vessel segment is the same, it is not classified.