Pergunta

I have been working on Face detection using opencv, C++ Eclipse. I got some problem with a program which is as

Rect faceRect;    
// Stores the result of the detection, or -1.   
int scaledWidth = 320; // Shrink the image before detection.    
detectLargestObject(cameraImg, faceDetector, faceRect, scaledWidth);    
if (faceRect.width > 0)    
   cout << "We detected a face!" << endl;

I don't know what does these parameters indicate in case of "detectLargestObject". Specially, "faceRect". I need some help. Please guide me appropriately as I am new to OpenCV.

Foi útil?

Solução

the code for the book is here: https://github.com/MasteringOpenCV/code

Outras dicas

There is no detectLargestObject method that is part of OpenCV. What you got is a custom method that someone implemented, presumably using OpenCV. What it does depends on where you got the code.

But from the snippet you posted, specifically the comment "// Stores the result of the detection, or -1.", faceRect is an out parameter and will contain the bounding rectangle of the found object after the method has been executed. scaledWidth is the width that the image will be scaled to before detection is performed

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top