Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

For those who find themselves in the same position, the problem was the division between integers results in an integer value instead of a double value. So this:

double scaleWidth = imgMat.width() / previewSizeWidth;
double scaleHeight = imgMat.height() / previewSizeHeight;

should be:

double scaleWidth = ((double) imgMat.width()) / ((double) previewSizeWidth);
double scaleHeight = ((double) imgMat.height()) / ((double) previewSizeHeight);

besides this the transportation works flawlessly.