user3719528
user3719528

Reputation: 1

some videos don't work with matlab with the next error

I am using matlab to detect faces.

Unfortunately, some videos don't work. It gives me the following error

Attempted to access bbox(1,:); index out of bounds because size(bbox)=[0,4].

Error in tracking (line 13) faceImage = imcrop(videoFrame,bbox(1,:));

Upvotes: 0

Views: 44

Answers (1)

Shai
Shai

Reputation: 114796

It seems like your face detector could not find any face for the specific frame videoFrame: the bounding box you got (bbox) is empty:

size(bbox)=[0,4]

You might want to add a condition before cropping that numel(bbox) > 0.

Upvotes: 3

Related Questions