image processing for robotics

37
IMAGE PROCESSINGBachelor of Technology in Electronic&Comm. Engineering DEPARTMENT OF Electronic&Comm. ENGINEERING APEX GROUP OF INSTITUTE SITAPURA, JAIPUR 2014 - 2015 SUBMITTED BY:- Mr. RAVI KHANDELWAL ROLL NO. 11EAGEC020

Upload: salaamchaus

Post on 15-Jul-2015

90 views

Category:

Presentations & Public Speaking


0 download

TRANSCRIPT

Page 1: Image processing for robotics

“IMAGE PROCESSING”

Bachelor of Technology in Electronic&Comm. Engineering

DEPARTMENT OF Electronic&Comm. ENGINEERING

APEX GROUP OF INSTITUTE SITAPURA, JAIPUR 2014 - 2015

SUBMITTED BY:- Mr. RAVI KHANDELWAL ROLL NO. 11EAGEC020

Page 2: Image processing for robotics

www.techienest.hpage.com

Jaipur Training Center

CF/O - 3&4 Nehru PlaceTonk RoadJaipur, RJ

Page 3: Image processing for robotics

Mat LabMat LabImage Processing Image Processing

Using Using

Content…Content…

1. Introduction2. The Mat lab Environment3. Why Matlab 4. What is an image5. Types of images6. Images in MatLab7. Image operation8. Image Acquisition9. GUI

Page 4: Image processing for robotics

• MATLAB is a numerical computing environment and programming language.

• Created by The MathWorks, MATLAB allows easy

• matrix manipulation, • plotting of functions and data, • implementation of algorithms, • creation of user interfaces, and • interfacing with programs in other languages. • computation, visualization, and programming in an easy-to-

use environment

MATLAB

Page 5: Image processing for robotics

The MATLAB Environment

• MATLAB window components:Workspace

> Displays all the defined variables

Command Window > To execute commands

in the MATLAB environment

Command History> Displays record of the

commands used

File Editor Window> Define your functions

Page 6: Image processing for robotics

WHY MATLAB

A good choice for vision program development because:

• Everything in MATLAB is a matrix ! • Easy to do very rapid prototyping

• A good library of image processing functions

• Widely used for teaching and research in universities and industry

• MATLAB does not need any variable declarations, no dimension statements, has no packaging, no storage allocation, no pointers

Page 7: Image processing for robotics

What is an Image…

• An image is an array, or a matrix, of pixels arranged in columns and rows.

• In a (8-bit) grayscale image each picture element has an assigned intensity that ranges from 0 to 255.

Page 8: Image processing for robotics

Images and Matrices

Column 1 to 256

Row

1 to 256

o

[0, 0]

o

[256, 256]

How to build a matrix(or image)?Intensity Image:

row = 256;col = 256;img = zeros(row, col);img(100:105, :) = 0.5;img(:, 100:105) = 1;figure;imshow(img);

Page 9: Image processing for robotics

1. Binary Images

2. Grayscale Image

3. RGB Image

Types of Images

Page 10: Image processing for robotics

Binary Image

A binary image is a digital image that has only two possible values for each pixel. Typically the two colors used for a binary image are black and white though any two colors can be used

Page 11: Image processing for robotics

Grayscale Image

• An image with 8-bit color depth, with grayscale intensities varying from 0 to 255.

Page 12: Image processing for robotics

RGB Image

• RGB: 24 bit per pixel, 3 eight bit unsigned integers (0 to 255) represent the intensities of red, green and blue.

(0, 0, 0) is black(255, 255, 255) is white(255, 0, 0) is red(0, 255, 0) is green(0, 0, 255) is blue(255, 255, 0) is yellow(0, 255, 255) is cyan(255, 0, 255) is magenta

Page 13: Image processing for robotics

Images in MATLAB

• MATLAB can import/export several image formats:

• BMP (Microsoft Windows Bitmap)• GIF (Graphics Interchange Files)• HDF (Hierarchical Data Format)• JPEG (Joint Photographic Experts Group)• PCX (Paintbrush)• PNG (Portable Network Graphics)• TIFF (Tagged Image File Format)• raw-data and other types of image data

Page 14: Image processing for robotics

Image Operations

• RGB image to gray image• Image resize• Image crop• Image rotate• Image blur• Image histogram• Convolution

Page 15: Image processing for robotics

Image Import and Export

• Read and write images in Matlab

img = imread('apple.jpg');dim = size(img);figure;imshow(img);imwrite(img, 'output.bmp', 'bmp');

• Alternatives to imshow

imagesc(I)

imtool(I)

image(I)

Page 16: Image processing for robotics

∗ RGB Image to Intensity Image (rgb2gray)∗ RGB Image to Indexed Image (rgb2ind)∗ RGB Image to Binary Image (im2bw)∗ Indexed Image to RGB Image (ind2rgb)∗ Indexed Image to Intensity Image (ind2gray)∗ Indexed Image to Binary Image (im2bw)∗ Intensity Image to Indexed Image (gray2ind)∗ Intensity Image to Binary Image (im2bw)∗ Intensity Image to RGB Image (gray2ind, ind2rgb)

Image Type Conversion

Page 17: Image processing for robotics

Image Display

• image - create and display image object

• imagesc - scale and display as image

• imshow - display image

• colorbar - display colorbar

• getimage - get image data from axes

• truesize - adjust display size of image

• zoom - zoom in and zoom out of 2D plot

Page 18: Image processing for robotics

Example: RGB IMAGE

i=imread('C:\Users\SACHIN\Desktop\DSC05563_1.jpg');imshow(i);

Page 19: Image processing for robotics

To convert rgb into grayscale image

i=imread('C:\Users\SACHIN\Desktop\DSC05563_1.jpg');j=rgb2gray(i); imshow(j);

Page 20: Image processing for robotics

To convert rgb into Binary image

i=imread('C:\Users\SACHIN\Desktop\DSC05563_1.jpg');k=im2bw(i); imshow(k);

Page 21: Image processing for robotics

EXAMPLES

∗ Image compression∗ Noise reduction∗ Edge extraction∗ Contrast enhancement∗ Segmentation∗ Image restoration

Page 22: Image processing for robotics

∗ Image compression∗ Noise reduction∗ Edge extraction∗ Contrast enhancement∗ Segmentation∗ Image restoration

EXAMPLES

Page 23: Image processing for robotics

EXAMPLES

∗ Image compression∗ Noise reduction∗ Edge extraction∗ Contrast enhancement∗ Segmentation∗ Image restoration

Page 24: Image processing for robotics

EXAMPLES

∗ Image compression∗ Noise reduction∗ Edge extraction∗ Contrast enhancement∗ Segmentation∗ Image restoration

Page 25: Image processing for robotics

EXAMPLES

∗ Image compression∗ Noise reduction∗ Edge extraction∗ Contrast enhancement∗ Segmentation∗ Image restoration

Page 26: Image processing for robotics

EXAMPLES

∗ Image compression∗ Noise reduction∗ Edge extraction∗ Contrast enhancement∗ Segmentation∗ Image restoration

Page 27: Image processing for robotics

Image Acquisition

Acquiring image from camera

• First of all check whether Image Acquisition adapter is installed and working To check it, please type the following command in command window and press enter:

>>imaqhwinfo

Page 28: Image processing for robotics

This signifies ‘winvideo’ adapter installed

Page 29: Image processing for robotics

Real Time video streaming:

To capture the video stream, type the following command in command window:

>> Var = videoinput(‘winvideo’,1,YUY2_640X480);

Previewing the real time video

where

Var is the variable in which real time video will be streamed.

type the following command in command window:

Syntax: Preview(Var);

Page 30: Image processing for robotics

Capturing Image from real time video:

To capture an image from real time video stream, we can use the command getsnapshot(X).

Syntax:

I=Getsnapshot(Var);

Viewing the captured Image:

To see the image captured and stored in variable I, in STEP 5, we can use the following command:

Syntax:

imshow(i);

Page 31: Image processing for robotics

We will have one color marker in our hand, red in our case. Through that we will change the position of that finger at four different corners of the 2-D image. Once it is done, the microcontroller section will have the Relay attached to it. And the Relay will control the four different devices as shown in figure.

Virtual Switch Board

Page 32: Image processing for robotics

Graphical User Interface

• GUIDE (graphical user interface development environment)

• GUIDE is command

• It is provides a set of tools for creating graphical user interfaces (GUIs).

• You also can create menus and context menus for the GUI

Page 33: Image processing for robotics

Tool Box

Using the GUIDE Layout Editor, you can populate a GUI by clicking and dragging GUI components—such as axes, panels, buttons, text fields, sliders. .

Page 34: Image processing for robotics

Example

Page 35: Image processing for robotics

∗ Medicine∗ Defense∗ Meteorology∗ Environmental science∗ Manufacture∗ Surveillance∗ Crime investigation

Applications

Page 36: Image processing for robotics

THE ENDTHE END

FOR YOUR FOR YOUR ATTENTION! ATTENTION!

Page 37: Image processing for robotics

ANY QUESTIONANY QUESTION