【问题标题】:translate gaussian noise in opencv to emgu cv [closed]将opencv中的高斯噪声转换为emgu cv [关闭]
【发布时间】:2013-04-05 10:52:03
【问题描述】:

我正在学习图像处理,我需要使用 emgu cv 在 c# 中制作高斯噪声。 我找到了代码

Mat gaussian_noise = img.clone();

randn(gaussian_noise,128,30);

在打开的 cv 中产生高斯噪声。 emgu cv中的翻译代码是什么?

【问题讨论】:

    标签: c# opencv noise emgucv


    【解决方案1】:

    搜索了一下,发现equivalent to randn on Emgu是Matrix上的SetRandNormal(MCvScalar, MCvScalar)方法。因此,要制作与您的代码类似的东西,您必须这样做:

    //Create your image as Image<Bgr,byte> here, for example.
    Matrix<byte> matrix = new Matrix<byte>(img.Width, img.Height);
    CvInvoke.cvConvert(img, matrix);
    matrix.SetRandNormal(new MCvScalar(128), new MCvScalar(30));
    //And Here you can convert back to image and do whatever you want.
    

    应该可以,但是我没有在这台机器上安装 Emgu,所以我现在无法测试它。

    祝你好运!

    【讨论】:

      猜你喜欢
      • 2014-08-26
      • 2015-04-08
      • 2017-06-03
      • 2016-02-07
      • 2016-08-16
      • 2016-08-17
      • 2011-12-08
      • 2013-06-13
      • 2013-01-04
      相关资源
      最近更新 更多