how to save all images features from a folder

조회 수: 4 (최근 30일)
sanaya khan
sanaya khan 2019년 3월 21일
댓글: Jan 2019년 3월 21일
FDetect = vision.CascadeObjectDetector;
myFolder = 'C:\dataSet';
filePattern = fullfile(myFolder, '*.jpg');
jpegFiles = dir(filePattern);
for k = 1:length(jpegFiles)
baseFileName = jpegFiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
imageArray = imread(fullFileName);
BB = step(FDetect, imageArray);
imshow(imageArray); hold on % Display image.
for i = 1:size(BB,1)
rectangle('Position',BB(i,:),'LineWidth',5,'LineStyle','-','EdgeColor','r');
end
title('Face Detection');
hold off;
%To detect Nose
NoseDetect = vision.CascadeObjectDetector('Nose','MergeThreshold',16);
BB=step(NoseDetect,imageArray);
figure,
imshow(imageArray); hold on
for i = 1:size(BB,1)
rectangle('Position',BB(i,:),'LineWidth',4,'LineStyle','-','EdgeColor','b');
end
title('Nose Detection');
hold off;
%To detect Mouth
MouthDetect = vision.CascadeObjectDetector('Mouth','MergeThreshold',16);
BB=step(MouthDetect,imageArray);
figure,
imshow(imageArray); hold on
for i = 1:size(BB,1)
rectangle('Position',BB(i,:),'LineWidth',4,'LineStyle','-','EdgeColor','r');
end
title('Mouth Detection');
hold off;
%To detect Eyes
EyeDetect = vision.CascadeObjectDetector('EyePairBig');
BB=step(EyeDetect,imageArray);
figure,imshow(imageArray);
drawnow; % Force display to update immediately.
end
the above code run prefectly but issue is that save last image value in a bounding box plz help me. how to face all bound box values in all images
  댓글 수: 1
Jan
Jan 2019년 3월 21일
What exactly is your question? "issue is that save last image value in a bounding box" is not clear to me.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by