I didn't read the whole article and can't program it up for you but with just a quick glance it looks like they're segmenting on different hues. So you could convert to HSV color space and get different "maps" for each hue by thresholding the hue channel
hsvImage = rgb2hsv(rgbImage);
hImage = hsvImage(:, :, 1);
color2 = hImage >= 0.1 & hImage < 0.2;
color3 = hImage >= 0.2 & hImage < 0.3;
If youi want to fill holes of a certain size, or remove blobs less than a certain size, you could also do that with imfill() or bwareaopen().