Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Clear now :) Your problem will be solved by using function convertTo():

double alpha = 65535.0 / (9000.0 - 7000.0);
double beta = -7000.0 * alpha;
image.convertTo(image, CV_16U, alpha, beta);

It's C++ but convertion to Python should be straightforward. If you wanna know more details about why, the answer in this post is very explanatory.