Code covered by the BSD License  

Highlights from
Max filter

2.0

2.0 | 1 rating Rate this file 11 Downloads (last 30 days) File Size: 1.3 KB File ID: #41608
image thumbnail

Max filter

by

 

This code is used for max filter

| Watch this File

File Information
Description

This code is for max filter and i have used it. It works very well in every images.

MATLAB release MATLAB 7.14 (R2012a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
03 May 2013 Jan Simon

This script starts with the brute clearing header "clc; clear all; close all;". This is a bad idea, because "clear all" deletes all breakpoints. Impeding the debugging is a very bad idea.

The algorithm is slow: The builtin function MAX is much faster than SORT and selecting the last element.
Expressions line "[d(i-1,j-1) d(i-1,j) d(i-1,j+1) d(i,j-1) d(i,j) d(i,j+1) d(i+1,j-1) d(i+1,j) d(i+1,j+1)]" can be accelerated: "d(i-1:i+1,j-1:j+1)".
The construction of "m=(1/9)*(ones(3,3));" can be omitted, because "m" is not used anywhere.

A function with inputs and outputs would be more useful than this script, which obtains the image by UIGETFILE. Without any comments and documentation the usability of this code is very low.

Contact us