Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It turns out the answer is not in Mat in Java, but in Imgproc, which has a resize().

if (resizedWindow.size().height < hogDetector.getWinSize().height || resizedWindow.size().width < hogDetector.getWinSize().width){
            logger.debug("resizedWindow size is too small, convert to 2 times the size");
            Size matsize = new Size(2.0*resizedWindow.size().width,2.0*resizedWindow.size().height);
            **Imgproc.resize**(frameToExamine.submat(resizedWindow), ROImat, matsize );
        }

The above code works, though I'm going to use an algorithm to provide more precise size adjustment.

It turns out the answer is not in Mat in Java, but in Imgproc, which has a resize().

if (resizedWindow.size().height < hogDetector.getWinSize().height || resizedWindow.size().width < hogDetector.getWinSize().width){
            logger.debug("resizedWindow size is too small, convert to 2 times the size");
            Size matsize = new Size(2.0*resizedWindow.size().width,2.0*resizedWindow.size().height);
            **Imgproc.resize**(frameToExamine.submat(resizedWindow), Imgproc.resize(frameToExamine.submat(resizedWindow), ROImat, matsize );
        }

The above code works, though I'm going to use an algorithm to provide more precise size adjustment.

It turns out the answer is not in Mat in Java, but in Imgproc, which has a resize().resize().

if (resizedWindow.size().height < hogDetector.getWinSize().height || resizedWindow.size().width < hogDetector.getWinSize().width){
            logger.debug("resizedWindow size is too small, convert to 2 times the size");
            Size matsize = new Size(2.0*resizedWindow.size().width,2.0*resizedWindow.size().height);
            Imgproc.resize(frameToExamine.submat(resizedWindow), ROImat, matsize );
        }

The above code works, though I'm going to use an algorithm to provide more precise size adjustment.