if rect height minSizes height rect height maxSizes height rect width

1
2
3
4
5
6
7
8
9
if((rect.height > minSizes.height && rect.height < maxSizes.height)&&
(rect.width > minSizes.width && rect.width < maxSizes.width)) {
double ratio = (double)rect.height / rect.width;
Mat submat = src.submat(rect);
Imgproc.resize(submat, submat, new Size(400, 400 * ratio));
findedRects.add(submat);
}