File Exchange

image thumbnail

Point Processing Techniques without using inbuilt functions

version 1.1 (1.54 KB) by

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

3 Ratings



View License

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

Comments and Ratings (6)

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


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..

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

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.



Updated as a tool box

MATLAB Release
MATLAB 8.0 (R2012b)

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

» Watch video

Win prizes and improve your MATLAB skills

Play today