I have an integer matrix and I want to perform an integer division on it. But opencv always rounds the result. I know I can divide each element manually but I want to know is th
Similar to @GPPK's optional method, you can hack it by:
Mat tmp, dst; c.convertTo(tmp, CV_64F); tmp = tmp / 8 - 0.5; // simulate to prevent rounding by -0.5 tmp.convertTo(dst, CV_32S); cout << dst;