视频的时域去噪

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(h, w)[0] - src.at(h, w)[0])
					 + abs(temImg[0].at(h, w)[1] - src.at(h, w)[1])
					 + abs(temImg[0].at(h, w)[2] - src.at(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(h, w)[i] = 0;
	
					dst.at(h, w)[i] = static_cast( 
                        

你可能感兴趣的:(图像滤波)