implementation of median filtre on FPGA ?

5 ビュー (過去 30 日間)
soukaina
soukaina 2023 年 3 月 18 日
コメント済み: soukaina 2023 年 3 月 25 日
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

回答 (1 件)

Bharath Venkataraman
Bharath Venkataraman 2023 年 3 月 23 日
You could use the Median Filter block or the visionhdl.MedianFilter System object in Vision HDL Toolbox, which offer this capability.
  1 件のコメント
soukaina
soukaina 2023 年 3 月 25 日
thank you

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by