• Undefined function 'wnr' for input arguments of type 'double'.

    From =?UTF-8?B?0JXQstCz0LXQvdC40Lkg0J3Qv@21:1/5 to All on Tue Mar 14 01:55:55 2023
    Hello, I keep getting this error. Can somebody show my mistake?

    %Restoring an image with a Wiener filter
    len = 21;
    theta = 11;
    % Class object declaration
    Ioriginal=im2double(imread('fon.jpg'));

    % Calling the filtered image function
    W = wnr(Ioriginal,len,theta);

    IW = deconvwnr(W.IFilter,W.PSF);

    imshow(IW)
    title('Restored Blurred Image')

    And class itself

    classdef L2wnr
    properties
    Ioriginal
    PSF
    len
    theta
    IFilter
    Id
    end
    methods
    function obj = wnr(Ioriginal,len,theta)
    obj.Ioriginal = Ioriginal;
    obj.len=len;
    obj.theta=theta;

    % Filter
    filter_type = 'motion';

    obj.PSF = fspecial(filter_type, len, theta)
    obj.IFilter = imfilter(obj.Ioriginal, obj.PSF, 'circular','conv')
    obj.Id = deconvwnr(obj.IFilter,obj.PSF)
    end
    end
    end

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)