This `i` variable conflicts with previous declaration in parent loop (see http://pullrequest.opencv.org/).