Upload
izaiah-rollie
View
224
Download
1
Tags:
Embed Size (px)
Citation preview
Imageprocessing
An introduction
What is image processing?
• image analysis
• patron recognition
• graphical manipulation
• datacompression
• data transmission
• multi media applications
2. Global Image operation
• Histogram
• Stretching
• Histogram Equalization
• Binarization/ Thresholding
• Math on images
Histogram
Histogram with MATLAB
%y=imread('zand.jpg');zon=zongray('mushroom2.jpg'); %zon equals contents of 'picuter' arraywaarde=zeros(1,256); % make an empty array[l,b]=size(zon); % measure picture sizefigure(1); % make a new pictureimage(zon); % show picturecolormap(gray(256)); % set gray colormapfor i=1:l % Go for every pixel from 1 to for j=1:b % Take care MATLAB arrays cannot start with 0! a=double(zon(i,j)); % Convert pixelvalue to double calculating with pixelvalues waarde(a+1)=waarde(a+1)+1; % if value is certain value add 1 for that value end end figure(2); % Make new (second figure) bar(waarde); % Give a bargraph of the result
Stretching
Stretching(2)
0 50 100 150 200 2500
1000
2000
3000
4000
5000
6000
7000
8000
9000
0 50 100 150 200 2500
1000
2000
3000
4000
5000
6000
7000
8000
9000
y=(x-64)*4
3. Local Operations
• Smoothing
• Low pass filtering
• Edge detection
• Directional edge detecting
• Min-max operation
• Sharpening
• Special filters
Local operation
• Make a new image depending on pixels in the neigtbourhood
• filtering.gif
Smoothingwith mean filter
filtering.gif
Smoothing with Gaussian Low pass
Edge detectionwith Laplacian operator
Edge detectionwith Laplacian operator(2)
L[f(x,y)] = d2f / dx2 + d2f / dy2
d2f / dx2 = f(x+1, y) - 2f(x, y) + f(x-1, y) d2f / dy2 = f(x, y+1) - 2f(x, y) + f(x, y-1)
L[f(x,y)] = -4f(x, y) + f(x+1), y) + f(x-1, y) + f(x, y+1) + f(x, y-1) (approx.)
Directional Edge Detection
demo
Filters.exe
4. Morphologie
• Erosion
• Dilitation
• Opening / closing
• Conditional erosion
• Skeleton
Erosion and Dilation8 and 4 connect influence
8-connect 4-connect
Erosion
Dilation
Erosion 8-connected
Dilation 8 connected
Opening and closing
Erosion and Dilation with thresholdthreshold=1 (at least 8 must be there)
Erosion Dilation applications
• Opening and closing. (For correct counting)• Deletes noise pixels• Makes connection at border lines• Skeleton• Perimeter determination
Conditional Erosion
• Keep the last pixel
• Keep connectednes
• Keep the end-pixel of a string of pixels with 1 pixel
Keep the last pixelReduction to 1 point
Skeletonexample application:characterrecognition
Image analysis
• Labeling
• Contour analysis