Click here to Skip to main content
15,860,859 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hey guys i want to convert below Matlab code to OpenCv C# Please help me and tell me about Equivalent Function in openCV
RGB = imread( 'd:\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);>
clear b;
SN=zeros(H,W);
for ind=1:length(SkinIndexRow)
    i= SkinIndexRow(ind);
    j= SkinIndexCol(ind);
    SN(i,j)=1;
end
clear SkinIndexCol;
clear SkinIndexRow;
L = bwlabel(SN,8);
BB  = regionprops(L, 'BoundingBox');
bboxes= cat(1, BB.BoundingBox);
lenRegions=size(bboxes,1);

rgb=label2rgb(L);
figure,imshow(rgb);
title('face candidates');
drawnow; pause(.1);


code block added
Posted
Updated 5-Apr-14 10:55am
v3
Comments
[no name] 6-Apr-14 10:58am    
Code Project is not a code translation service.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900