var activationContext = Type.GetTypeFromProgID("matlab.application.single"); var matlab = (MLApp.MLApp)Activator.CreateInstance(activationContext); byte b = new byte(); string a = "RGB = imread('c:\02.jpg');" + " I=double(RGB);" + " W=size(I,2);" + " H=size(I,1);" + " cform = makecform('srgb2lab');" + " lab = applycform(RGB,cform);" + " b=lab(:,:,2);" + " [SkinIndexRow,SkinIndexCol] =find(127<b);" + " SN=zeros(H,W);" + " for ind=1:length(SkinIndexRow)" + " i= SkinIndexRow(ind);" + " j= SkinIndexCol(ind);" + " SN(i,j)=1;" + "end " + "L = bwlabel(SN,8); " + "BB = regionprops(L, 'BoundingBox'); " + "bboxes= cat(1, BB.BoundingBox); " + "lenRegions=size(bboxes,1); " + "rgb=label2rgb(L); "; object f = matlab.GetVariable(a, "rgb");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)