The detectMultiscale method does not return any confidence factor, however, depending on your application, it might be possible to achieve one without recurring to complex methodologies.
If detection is being performed at multiple scales, it is expected that, in some cases, the same object is detected more than once in the same image. So, it is safe to assume that an object detected 2 times has a higher confidence measure than one that was detected one time. In the detectMultiscale method pass the minNeighbours argument as 0 so the algorithm doesn't aggregate any detections.
If you are detecting in sequential frames from a still camera, you can even create your own confidence evaluator algorithm. If the same object is detected multiple times in a number of sequential frames, it is assumed that this object has a higher confidence level, whereas if an object is detected in some frames but not in others, it has a less confidence measure. Be creative.
You have to calculate your own confidence score if you really need it. That means you need to crack up the source code and keep track of your weights and stage confidence factors. You should read the Viola & Jones paper to determine the correct way of calculating the confidence value.
I ve just have to calculate output y (viola-jones) using the weights from the xml file? Or I ve got to rebuilt opencv in order to keep track of the calculated weights??
Offcourse but you need the prediction rate of each stage, how well the feature got evaluated of a test image using the stored weights/thresholds. It is not that straigtforward.
I ll take a closer look, thanks anyway!!