• 卷积相关公式的matlab代码


    取半径=3

    用matlab代码实现上式公式:

    length=3;
    for Ki = 1:length
      for Kj = 1:length
        for Kk = 1:length
          Ksigma(Ki,Kj,Kk)=exp(-(Ki-2)^2/8-(Kj-2)^2/8-(Kk-2)^2/8);                                 此公式为:K(u), ρ=3
        end
      end
    end

    KONE = convn(ones(size(Img3D_mc,1),size(Img3D_mc,2),size(Img3D_mc,3)),Ksigma,'same');  此公式为:∫k(x-y)dx

    D_I(:,:,:,nn)= KONE.*Img(:,:,:,nn).^2-2*C(nn,kk)*Img(:,:,:,nn).*convn(B(:,:,:,nn),Ksigma,'same')+C(nn,kk)^2*convn(B(:,:,:,nn).^2,Ksigma,'same');

    注:

  • 相关阅读:
    生成器
    迭代器
    装饰器
    闭包函数
    函数对象
    函数
    文件
    字符编码
    基本的数据类型和内置方法02
    基本的数据类型和内置方法01
  • 原文地址:https://www.cnblogs.com/txg198955/p/5600642.html
Copyright © 2020-2023  润新知