View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Averaging Filter without using imfilter

2.6 | 8 ratings Rate this file 30 Downloads (last 30 days) File Size: 1.28 KB File ID: #41082 Version: 1.1
image thumbnail

Averaging Filter without using imfilter


yagnesh (view profile)


02 Apr 2013 (Updated )

Filters the image nicely without using imfilter

| Watch this File

File Information

put the image in your current directory and change the name of your image in the code.
run the code
will ask you to input the value of averaging mask.

enter 3 if you want to use 3*3
enter 5 if you want to use 5*5

thats it.

Required Products Image Processing Toolbox
MATLAB release MATLAB 8.0 (R2012b)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (10)
13 Oct 2016 Hashim Shafiq

08 May 2016 Ali Soleimani

20 Mar 2014 Arjunsinh Parmar

22 Apr 2013 Divyarajsinh Parmar

20 Apr 2013 shivangi patel

shivangi patel (view profile)

20 Apr 2013 shivangi patel

shivangi patel (view profile)

03 Apr 2013 yagnesh

yagnesh (view profile)

hello simon...
i have compared the result with inbuilt matlab function for averaging.
and the code is developed according to the basic concept of averaging filter.
so i didn't find any fault or error although the result was quite nice.

if you have made a code in your own logic then i will be happy to see it.
thank you

Comment only
03 Apr 2013 Jan Simon

Jan Simon (view profile)

I do not think that "round(median())" matches "without using built-in functions.
The brute clearing header "clc; clear all; close all;" removes all functions from the memory, such that reloading wastes much time, and all breakpoints of the debugger are clear also. But it is a really bad idea to prevent debugging conceptionally.

Using "sum" as name of a variable leads to errors frequently, when the user wants to use the function with the same name. Therefore it is recommended not to shadow built-in functions.

It would be much more useful for others, if the code is written as a function and the parameters and data are provided as input arguments. Using INPUT in a script is not convenient and not usable in productive code. Using "ans" to provide a result is a bad idea, because this is overwritten by the last not caught output of any function. Therefore the result can change unexpectedly during debugging.

For educational purposes, applying Matlab's vectorized methods would be much more valuable and substantially faster. Without a documentation and any comments in the code, modifications demands for guessing what the code should achieve.

My conclusion: This is neither useful nor usable in productive code, nor helpful for eductaional purposes.

03 Apr 2013 yagnesh

yagnesh (view profile)

conv2 is the inbuilt function but here logic implemented without any inbuilt function.
so i calculated each coefficient without using inbuilt functions.

Comment only
02 Apr 2013 Anon

Anon (view profile)

refer to the function conv2 to be much more efficient in calculating an averaging filter.

21 Nov 2014 1.1

updated as a toolbox

Contact us