how to built mean filter without padding ?
8 views (last 30 days)
Show older comments
Muhammad on 21 Aug 2021
Commented: DGM on 22 Aug 2021
i want this mean filter without padding and padding by replication .here in my code i have done padding with 1
a = input('Please input the matrix like "[1, 2; 3, 4]":');
% mf= ones(3,3)
% meanA = mean(A(:))
a1= padarray(a,[1 1],1)
for j =2:(n-1)
what modification do i need for this?
DGM on 22 Aug 2021
If you want to pad by replication, use the 'replicate' flag with padarray(). If you want to do the filtering without padding, you'll need to adjust your indexing limits accordingly, and you'll need to truncate your filter window as you operate near the image edges. Obviously, that sort of complication is why it's simpler to just use padding.
Find more on Digital Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!