Reputation: 28542
How to change base type (not # of channels) of image in OpenCV? E.g. convert CV_8UC1
to CV_32SC1
and vice versa?
Note: the objective is to overcome type overflow during computations and not to display expanded image.
Upvotes: 1
Views: 457
Reputation: 8725
You have to use convertTo method for this:
Converts an array to another data type with optional scaling.
Upvotes: 1