4.33333

4.3 | 3 ratings Rate this file 24 Downloads (last 30 days) File Size: 1.54 KB File ID: #41104
image thumbnail

Point Processing Techniques without using inbuilt functions

by

 

computes image negative,basic thresholding,contrast stretching,graylevel slicing with/without back

| Watch this File

File Information
Description

run the code and input different values for different operations like graylevel slicing with/without back ground,basic thresholding operation,image negative,contrast stretching.

Required Products Image Processing Toolbox
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
20 Mar 2014 Arjunsinh Parmar  
22 Apr 2013 Divyarajsinh Parmar  
18 Apr 2013 shivangi patel  
05 Apr 2013 Christian Wuerslin

Hi again,

no worries. What you did is not a mistake after all, it is correct. However, if you are planning on continue working with Matlab in the future you can save yourself a lot of effort by understanding what makes Matlab different from other languages.

Cheers, Christian

04 Apr 2013 yagnesh

Hi Christian Wuerslin
Thanks ...
u r absolutely right but i forgot that silly mistake.

thanks again will help me lot in future..

04 Apr 2013 Christian Wuerslin

Hi Yagnesh,

please be aware, that Matlab is not like C or any other compiled language. Matlab is interpreted at run-time and therefore long scripts (or a lot of loops) are very time-consuming. Matlab solves this by supplying powerful matrix operations. Your code

for i=1:m
for j=1:n
z(i,j)=(G-1)-y(i,j);
end
end

can be simply replaced by

z = (G-1) - y;

What happens is that Matlab automatically detects that y is a matrix of a certain size and returns a a matrix z of the same size. The loops you use are preformed automatically (and way faster). Note that this only works if G is a scalar (in your case) or if G has the same size as y.
The same applies to all loops in your submission. Hope this helps you in future projects.

Contact us