2.8

2.8 | 6 ratings Rate this file 41 Downloads (last 30 days) File Size: 1.28 KB File ID: #41082
image thumbnail

Averaging Filter without using imfilter

by

 

02 Apr 2013 (Updated )

Filters the image nicely without using imfilter

| Watch this File

File Information
Description

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
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 (8)
20 Mar 2014 Arjunsinh Parmar  
22 Apr 2013 Divyarajsinh Parmar  
20 Apr 2013 shivangi patel  
20 Apr 2013 shivangi patel  
03 Apr 2013 yagnesh

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

03 Apr 2013 Jan Simon

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

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

02 Apr 2013 Anon

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

Updates
21 Nov 2014

updated as a toolbox

Contact us