After we calculate the stroke widths, we group the
pixels into CCs. We first apply an open operation to
the stroke width image to improve separation between
CCs. We then apply a #ood-!ll algorithm based on consistency in stroke width and color. Color consistency is
measured using distance in the Lab color space, where
distance and perceived color are linearly related [7].
Adjacent pixels are connected if the larger-to-smaller
stroke width ratio is less than 3 and the Lab distance is
less than 30, ensuring that each component is uniform
in both stroke width and color. The input image masked
by the current CCs is shown in Figure 2f.