implementation of median filtre on FPGA ?
    조회 수: 5 (최근 30일)
  
       이전 댓글 표시
    
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
댓글 수: 0
답변 (1개)
  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.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

