如何将Matlab转换为OpenCV C# [英] how to Convert Matlab to OpenCV C#

查看:102
本文介绍了如何将Matlab转换为OpenCV C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们我想将Matlab代码转换为OpenCv C#请帮我告诉我openCV中的等效功能

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

推荐答案

这篇关于如何将Matlab转换为OpenCV C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆