欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

tiff转jpg图

程序员文章站 2022-05-28 14:28:45
...
void normalizeTiff(const Mat& OrignalImg, Mat& OrignalImg_16Bit, Mat& OrignalImg_8Bit, int iPos)
{
 Mat orignalImgcopy = OrignalImg.clone();
// orignalImgcopy = min(g_CameraParam[iPos].iGrayMax, OrignalImg);
 Mat realSrc, normimg;
 orignalImgcopy.convertTo(realSrc, CV_32FC1);
 Rect headRect(0, 0, OrignalImg.cols, 20);
 cv::medianBlur(realSrc(headRect), realSrc(headRect), 5);
 normalize(realSrc, normimg, 1, 0, NORM_MINMAX);
 OrignalImg_8Bit = normimg * 255;
 OrignalImg_8Bit.convertTo(OrignalImg_8Bit, CV_8UC1);
 OrignalImg_16Bit = normimg*(65535);
 OrignalImg_16Bit.convertTo(OrignalImg_16Bit, CV_16UC1);
}