Raspberry Pi 3 - Camera Face Detection - ??? Build error: C compiler produced errors. See the Build Log for further details.

3 views (last 30 days)
Alessio Gagliardi
Alessio Gagliardi on 23 Oct 2018
Dear all,
I am trying to run a standalone application of face detection using a raspberry pi and a camera. I am using the package runOnHardware and during the generation of the C/C++ code I got this error:
>> mypi = raspi('xx.xx.xx.xx','pi','raspberry');
>> runOnHardware(mypi,'faceDetection')
------------------------------------------------------------------------
Function TAR tried to add two files as "types_c.h".
------------------------------------------------------------------------
??? Build error: C compiler produced errors. See the Build Log for further details.
Code generation failed: View Error Report
Error using codegen
Error in runOnHardware (line 52)
codegen('-config ',cfg,fcnName,'-report');
This is my simple faceDetection function:
function faceDetection()
%#codegen
w = matlab.raspi.webcam(0,[320,240]);
d = matlab.raspi.SDLVideoDisplay;
for k = 1:1000
img = snapshot(w);
fD = vision.CascadeObjectDetector();
bbox = step(fD, img);
coder.varsize('bbox',[20 4]);
imageOut = insertObjectAnnotation(img,'rectangle',bbox,'face');
displayImage(d,imageOut);
end
release(w);
release(d);
end
Could you please tell me how to solve the problem? Is vision.CascadeObjectDetector System object compatible with such procedure?
Many Thanks in advance.
Ale

Answers (0)

Community Treasure Hunt

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

Start Hunting!