Category Archives: Digital Image Processing

Watersheding Image Processing

Found this link below very helpful
http://cmm.ensmp.fr/~beucher/wtshed.html 

And wikipedia is good for knowledge,

https://en.wikipedia.org/wiki/Watershed_(image_processing)

Loop example in MATLAB

Loop example in MATLAB

Output:

A =

1 2 3
4 5 6
7 8 9
C =

1 2 3 4 5 6 7 8 9

Matrix in MATLAB

A=[1 2 3;4 5 6;7 8 9]

A =

1 2 3
4 5 6
7 8 9

B=[2 3 4;5 6 7;8 9 10]

B =

2 3 4
5 6 7
8 9 10

A+B

ans =

3 5 7
9 11 13
15 17 19

F=A-B

F =

-1 -1 -1
-1 -1 -1
-1 -1 -1

A’

ans =

1 4 7
2 5 8
3 6 9

size(A)

ans =

3  3

 

It may help

Matlab Code – Digital Image Processing

To show image from desktop folder to matlab image viewer

then to convert YIQ value we need to write this line

and for converting rgb to hsv we need tghis line

 

To make it grayscale

For showing the size:

For plotting in a matrix it follow subplot(m,n,p), imshow(X); format of 2×2 matrix 1 no. coloumn where p=1 and if p=2 then it will be plot in 2 no column

subplot

For finding edges from grayscale image and plot in coloumn 3 using canny method

 

For finding edges from grayscale image and plot in coloumn 4 using sobel method

Example:

subplot-4

Digital Image Processing