implementation of median filtre on FPGA ?

Hi everyone, I want to design the median filter on FPGA. I got the output for median filter in matlab and also in matlab simulink. i tried to convert the matlab code to HDL code with HDL coder. but i found alwais this error '' Found unsupported dynamic matrix type at output port: 0, name 'im_med', in the file/function MedFiltre_fixpt " .someone can help me ?
function [im_med] = MedFiltre(J,n,M,N)
Img=zeros(N,M);
for i = 1:M
for j = 1:N
pixel_val = J((i-1)*N + j); % Récupérer la valeur du pixel correspondant dans le vecteur
Img(j,i) = pixel_val; % Copier la valeur du pixel dans la matrice carrée
end
end
p=(n-1)/2;
im_med=zeros(N,M);
im_med = coder.nullcopy(zeros(N, M));
for i=p+1:M-p
for j=p+1:N-p
img0=Img(i-p:i+p,j-p:j+p);
V0=img0(:);
V1=sort(V0);
Im=round(n*n/2);
med=V1(Im);
im_med(i,j)= med;
end
end
%im_med=im_med(:);
end

Answers (1)

Categories

Find more on Code Generation in Help Center and File Exchange

Asked:

on 18 Mar 2023

Commented:

on 25 Mar 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!