Code covered by the BSD License

### Highlights from Point Processing Techniques without using inbuilt functions

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

# Point Processing Techniques without using inbuilt functions

by

### yagnesh (view profile)

03 Apr 2013 (Updated )

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

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
MATLAB release MATLAB 8.0 (R2012b)
MATLAB Search Path
/
Tags for This File   Please login to tag files.
Comments and Ratings (6)
20 Mar 2014 Arjunsinh Parmar

### Arjunsinh Parmar (view profile)

22 Apr 2013 Divyarajsinh Parmar

### Divyarajsinh Parmar (view profile)

18 Apr 2013 shivangi patel

### shivangi patel (view profile)

05 Apr 2013 Christian Wuerslin

### Christian Wuerslin (view profile)

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

Comment only
04 Apr 2013 yagnesh

### yagnesh (view profile)

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

thanks again will help me lot in future..

Comment only
04 Apr 2013 Christian Wuerslin

### Christian Wuerslin (view profile)

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.

Comment only
21 Nov 2014

Updated as a tool box