Itseez/opencv — pull request #445 by pppoe (2013-02-06 19:07:57+00:00)
Title: detectMultiScale: processingRectSize issue

The current processingRectSize can lead to detected rectangle 1 pixel beyond the original image, if you use the detected rectangle to crop out the detected object, program crashed.

Size processingRectSize( scaledImageSize.width - originalWindowSize.width + 1, scaledImageSize.height - originalWindowSize.height + 1 );

I am not sure why there is 1 extra pixel adding to the processingRectSize's width and height, by removing the extra +1 pixel fix the issue.