Hello everyone can someone explain to me why this code is not working for skin segmentation , Im trying to apply a bounding box jsut for skin region but looks that the whole image is in an bounding box

4 views (last 30 days)
clc
clear
close all
warning off
c=webcam;
faceDetector = vision.CascadeObjectDetector;
while true
e=c.snapshot;
mkdir=createMask(e);
mkdir=imfill(mkdir,'holes');
mkdir=bwareafilt(mkdir,3);
labeledImage = bwlabel(mkdir);
measurements = regionprops(labeledImage,'BoundingBox'); %#ok<MRPBW>
subplot(1,2,1);
imshow(e);
subplot(1,2,2);
imshow(e);
hold on;
for k = 1 : length(measurements)
thisBB = measurements(k).BoundingBox;rectangle('Position', [thisBB(1),thisBB(2),thisBB(3),thisBB(4)],...
'EdgeColor','b','LineWidth',5 )
end
hold off
end
using the createmask with my skin colour

Answers (0)

Categories

Find more on Computer Vision Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!