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);
}
上一篇: php简单的分页程序第1/5页
下一篇: 设计一个求直角三角形斜边长的函数