image processing
DESCRIPTION
image processing useful for OCRTRANSCRIPT
![Page 1: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/1.jpg)
DIGITAL IMAGE PROCESSING( useful for optical charactor recognition) USING
MATLAB
Presented by- ANTRIKSH SAXENA
B-TECH 2nd year ELECTRICAL ENGG.
![Page 2: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/2.jpg)
IMAGE• A digital image is a representation of a two-dimensional image
as a finite set of digital values, called picture elements or pixels.
• The image is stored in computer memory as 2D array of pixels.
• These pixels takes memory to store according to there variable type like ---double,logical,uint8,uint16, uint32,char etc.
Digital images can be created by a variety of input devices and techniques:-digital cameras-scanners
Digital images can be classified as-ColorGrayscaleBinary
![Page 3: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/3.jpg)
• rgb2gray – RGB image or colormap to grayscale.
• im2bw – image to binary image by thresholding.
• im2double – image array to double precision.• im2uint8 – image array to 8-bit unsigned
integers.• im2uint16 – image array to 16-bit unsigned
integers.
![Page 4: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/4.jpg)
COLOUR IMAGE• There are different colour spaces to represent colour image.
1. RGB colour space.2. NTSC colour space.3. HSV colour space.4. YCbCr colour space......etc.
• We will only consider RGB colour space here to represent colour images.
• In RGB colour space there are 3 images layers- RED,GREEN,BLUE. GREYSCALE IMAGE(GSI)
- The above 3 images Red,Green,Blue are called greyscale images.- These 3 greyscale image overlaps to form RGB image.- In GSI there are different intensity’s pixels of red,blue green colours
are available to overlap to form colour image’s pixels.
![Page 5: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/5.jpg)
BINARY IMAGE• This type of image contains pixels of logical memory (0 or 1). - This is also called black and white image.
IMAGE PROCESSING USING MATLAB what is image processing??-• Digital image processing focuses on two major tasks –Improvement of pictorial information for human interpretation –Processing of image data for storage, transmission and representation
for autonomous machine perception .
![Page 6: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/6.jpg)
![Page 7: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/7.jpg)
Read the image in matlab.>> a=imread('image.jpg');>> imshow(a)
convert the image in grey scale.>> g1=a(:,:,1);..........this is RED component of RGB.>> imshow(g1)
convert the image in binary image.>>bw=g1>150;.....if value of pixel>150 then 1
if value of pixel<150 then 0 >>imshow(bw)
![Page 8: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/8.jpg)
Read the colour imageRGB(colour image)
![Page 9: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/9.jpg)
Convert to GREY SCALE IMAGE
![Page 10: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/10.jpg)
Convert to BINARY IMAGE
![Page 11: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/11.jpg)
MORPHOLOGY-Binary images may contain numerous imperfections. In particular, the binary regions produced by simple thresholding are distorted by noise and texture. Morphological image processing pursues the goals of removing these imperfections by accounting for the form and structure of the image. These techniques can be extended to greyscale images.
• # edge ditection• # dilation• # filling• # filtering(convolution & corelation)• # region properties(centroid, area, bounding box).
etc.
![Page 12: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/12.jpg)
EDGE ditection by binary image
• Edge detection is identifying points in a digital image at which the image brightness changes sharply or, more formally, has discontinuities. >> Itedge = edge(uint8(bw));>> imshow(Itedge)
![Page 13: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/13.jpg)
IMAGE dilation
![Page 14: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/14.jpg)
FILLING the bound areas• This process fills the bounding areas in edge ditected binary image.
>> Itfill= imfill(Iedge2,'holes');>> imshow(Itfill)
![Page 15: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/15.jpg)
Process in single step
![Page 16: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/16.jpg)
![Page 17: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/17.jpg)
Discrete the diff. Elements in image>> [label num] = bwlabel(fill); props = regionprops(label); - This regionprops provides a STRUCTURE(props) which contains =
# centroid’s cordinates of diff. Elements # area of box bounding pefectly the elements
# bounding box.
Counting the no. of elements- In above commands ‘num’ is the total number of elements
in filled image.- Which is shown in next slide.
![Page 18: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/18.jpg)
Counting the no. of elements
![Page 19: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/19.jpg)
Make the bounding box around elements
Itbox = [Itprops.BoundingBox]; Itbox = reshape(Itbox,[4 numt]); imshow(It) hold on;
for cntt = 1:numt rectangle('position',Itbox(:,cntt),'edgecolor','r');
end........this command make the bounding box to each elements & descrete them.
![Page 20: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/20.jpg)
Processing on RGB image
• Function imadjust =Is the basic IPT tool for intensity transformations of gray-scale images. It has the syntax:g = imadjust (f, [low_in high_in], [low_out high_out], gamma)
• As illustrated in figure 3.2 (above), this function maps the
intensity values in image f to new values in g, such that values between low_in and high_in map to values between low_out and high_out. • Values below low_in and above high_in are clipped; that is values
below low_in map to low_out, and those above high_in map to high_out.
![Page 21: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/21.jpg)
>> f = imread ('baby-BW.jpg');>> g = imadjust (f, [0 1], [1 0]);>> imshow(f), figure, imshow (g);>> imshow(f), figure, imshow (g);
>> g = imadjust (f, [0.5 0.75], [0 1], .5);>> imshow(f), figure, imshow (g);
![Page 22: Image processing](https://reader034.vdocuments.net/reader034/viewer/2022051817/547d6ebcb4af9fe35f8b45dc/html5/thumbnails/22.jpg)