I need to pass a video buffer through a bandpass filter for a project I'm working on. The bandpass filter involves both an FFT and an IFFT, as well as a flattening of the frequencies outside of the pass band. In order to accomplish this, I need to have more room to store values than is available in the standard uchar type, so I am temporarily converting my video frames to CV_64F, with the plan to convert them back to CV_8UC3. Here is my question:
What is the behavior of OpenCV when converting cv::Mat data from a large data type to a smaller one? More specifically, if I have values in a cv::Mat object with CV_64F data that are larger than the maximum possible value for a single data point in CV_8U, does OpenCV set the target data to the maximum possible value for that data type, or do we have an overflow or truncating problem?