How can I use face extracted from bounding box in my face recognition code.?

2 views (last 30 days)
I have three persons in front of camera and using FaceDetect = vision.CascadeObjectDetector; I am getting bounding box around all the three faces. I want to track a particular face which is saved in data base of my face recognition code. for this i am using the code below but getting errors.
temp=getdata(vid,1);
index1=bbox(1,:);
face1=temp(index1(2):index1(2)+index1(4),index1(1):index1(1)+index1(3),:);
R=imagesc(face1);
name1=recognize(R); .....my face recognition function
and I am getting error Error using rgb2gray>parse_inputs (line 81) MAP must be a m x 3 array.
Error in rgb2gray (line 35) X = parse_inputs(varargin{:});
Error in get_face (line 11) img=rgb2gray(img);
Thanks in advance

Answers (0)

Community Treasure Hunt

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

Start Hunting!