bool imgProcess::deNoiseTem(Mat src, Mat &dst)
{
temImg.push_back(src);
dst = src.clone();
if (temImg.size() < 2)
{
return false;
}
else
{
int dstHeight = dst.rows;
int dstWith = dst.cols;
float weight[2] = { 0 };
for (int h = 0; h < dstHeight; h++)
{
for (int w = 0; w < dstWith; w++)
{
int Sad = 0 ;
Sad = abs(temImg[0].at<Vec3b>(h, w)[0] - src.at<Vec3b>(h, w)[0])
+ abs(temImg[0].at<Vec3b>(h, w)[1] - src.at<Vec3b>(h, w)[1])
+ abs(temImg[0].at<Vec3b>(h, w)[2] - src.at<Vec3b>(h, w)[2]);
weight[0] = 0.5f * (1.f * Sad / MAX_SAD_THRESH);
weight[0] = weight[0] > 0.5f ? 0.5f : weight[0];
weight[0] = 0.5f - weight[0];
weight[1] = 1 - weight[0];
for (int i = 0; i < 3; i++)
{
dst.at<Vec3b>(h, w)[i] = 0;
dst
视频的时域去噪
最新推荐文章于 2024-05-27 11:18:27 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)