The output argument is maskOut. Assuming k=3, then the value of each pixel of maskOut= p1*centroid1+p2*centroid2+p3*centroid3.
pi (i=1,2,3) is the probability that this pixel belong to the group i (i=1,2,3).
centroid i(i=1,2,3) is the center (RGB space) of the group i (i=1,2,3);

can any one tell me the execution of this code because it errors like
??? Input argument "k" is undefined.

Error in ==> kGaussian_color_EM at 56
[p,u,v]=em(raw,k);

??? Input argument "k" is undefined.

Error in ==> kGaussian_color_EM at 56
[p,u,v]=em(raw,k);

??? Error: File: kGaussian_color_EM.m Line: 3 Column: 1
Function definitions are not permitted at the prompt or in scripts.
please send me the details of this code to mohammadgousal@gmail.com. thank you

The output argument is maskOut. Assuming k=3, then the value of each pixel of maskOut= p1*centroid1+p2*centroid2+p3*centroid3.
pi (i=1,2,3) is the probability that this pixel belong to the group i (i=1,2,3).
centroid i(i=1,2,3) is the center (RGB space) of the group i (i=1,2,3);