MATLAB: Create L*a*b coordinates and save them in MAT file .

color measurementImage Processing Toolboxlab color spacemaskMATLABregion coordinate

How can I set region coordinate as sample regions. I want to create something like file regioncoordinates made by MATLAB.
I need to create a matrix of sample coordinates saved in a MAT file. And these region coordinates to be used with roipoly function for creating sample regions. and then to calculate the average color of the each sample in L*a*b space
I found an example 'Color-based Segmentation Using the L*a*b Color Space' but this example use their regioncoordinates file.
I have no idea how to do that.

Best Answer

Not sure what you're asking, but I think you might want to follow these steps
  1. read in and display image
  2. call drawfreehand()
  3. convert your image to lab with rgb2lab()
  4. separate your lab image to 3 separate monochrome images: lImage, aImage, bImage
  5. use the mask from drawfreehand() to get the means
meanL = lImage(mask);
meanA = aImage(mask);
meanB = bImage(mask);