Problem with defining an argument (face detection)
이전 댓글 표시
Hello. I downloaded a source code to learn something more about the face detection in matlab, but when I try to run the program I get this kind of massage:
??? Input argument "inputimage" is undefined.
Error in ==> face_detection at 7
[likely_skin]=get_likelyhood(inputimage,rmean,bmean,rbcov);
This is the function that is not working:
function face_detection(inputfile)
[rmean,bmean,rbcov]=make_model();
[likely_skin]=get_likelyhood(inputfile,rmean,bmean,rbcov);
[skinBW,opt_th] = segment_adaptive(likely_skin);
[erodedBW]=label_regions(skinBW);
[eulerBW]=euler_test(erodedBW);
[aspectBW]=aspect_test(eulerBW);
[templateBW]=template_test(aspectBW,inputfile,'template.jpg');
[K,P]=bwlabel(templateBW,8);
s = regionprops(bwlabel(templateBW), 'centroid');
centroids = cat(1, s.Centroid);
subplot(4,3,12);
imshow(imread(inputfile))
if(P>0)
hold on
plot(centroids(:,1), centroids(:,2), 'b*')
hold off
end
title('Final Detection')
clear all
It would be helpful if someone could help me. If u need i can post all of the sorce code. Or post link to the code.
답변 (1개)
Walter Roberson
2011년 10월 26일
0 개 추천
The source code you show does not match your error message. The error message has inputimage as the first argument to get_likelyhood, but the code you show has inputfile in that location.
Perhaps you did not save the code after you modified it?
댓글 수: 4
Walter Roberson
2011년 10월 26일
이동: DGM
2023년 12월 29일
How exactly are you invoking your code? If you are running it by pressing F5, or by clicking on Run, or by giving the command
face_detection
at the command line, then no value would be passed in for the inputfile and you would get the error you see.
You need to use the command line and invoke something like
face_detection('lena.jpg')
Walter Roberson
2011년 11월 4일
이동: DGM
2023년 12월 29일
You can use the rectangle() function to plot rectangles.
카테고리
도움말 센터 및 File Exchange에서 Downloads에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!