O'Reilly logo

Visual Media Processing Using MATLAB Beginner's Guide by George Siogkas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – color isolation using CIE-L*a*b*

This time we will perform color isolation for our lake fence photograph, using just channel a*. The goal will remain at converting the whole image to grayscale, except the fence tips that should remain red. For comparison purpose, we will also perform the RGB process. We will follow these steps:

  1. First, we will load the image and generate the same mask as before, using thresholding, cleaning, and dilation:
    >> img = imread('my_image_color.bmp');
    >> [output2] = RGBThreshold(img,[160 130 130]);
    >> output(1:100,:) = 0;
    >> maskRGB = imdilate(output2,strel('disk', 2));
  2. Let's produce the mask using CIE-L*a*b* color space:
    >> cform = makecform('srgb2lab'); % Make the transform structure >> img_lab = applycform(img,cform); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required