Automation and Drives SIMATIC HMI The Human Machine Interface for internal use only Scope of...

10
Automation and Drives SIMATIC HMI The Human Machine Interface for internal use only Scope of Presentation Dept. of Industrial Electronics and Control Eng. Faculty of Electronic Engineering Use Morphological Opening to Estimate the Background Read The Image Introduction Threshold the Image Subtract Background Image from Original Image Questions and Discussion Minoufiya University Increase the Image Contrast Eng./ Essam Nabil 2011 - 2012 Biomedical Laboratory – 4 th Year Correcting Nonuniform Illumination Part : one Image Processing Using MATLAB Lab. No.“4”

Transcript of Automation and Drives SIMATIC HMI The Human Machine Interface for internal use only Scope of...

Page 1: Automation and Drives SIMATIC HMI The Human Machine Interface for internal use only Scope of Presentation Dept. of Industrial Electronics and Control Eng.

Automation and Drives

SIMATIC HMIThe Human Machine Interface

for internal use only

Scope of Presentation

Dept. of Industrial Electronics and Control Eng.Faculty of Electronic Engineering

Use Morphological

Opening to Estimate the

Background

Read The Image

Introduction

Threshold the Image

Subtract Background

Image from Original

Image

Questions and

DiscussionMinoufiya University

Increase the Image

Contrast

Eng./ Essam Nabil 2011 - 2012

Biomedical Laboratory – 4th Year

Correcting Nonuniform Illumination

Part : oneImage Processing Using MATLAB

Lab. No.“4”

Page 2: Automation and Drives SIMATIC HMI The Human Machine Interface for internal use only Scope of Presentation Dept. of Industrial Electronics and Control Eng.

Automation and Drives

SIMATIC HMIThe Human Machine Interface

for internal use only

Scope of Presentation

Dept. of Industrial Electronics and Control Eng.Faculty of Electronic Engineering

Use Morphological

Opening to Estimate the

Background

Read The Image

Introduction

Threshold the Image

Subtract Background

Image from Original

Image

Questions and

DiscussionMinoufiya University

Increase the Image

Contrast

Eng./ Essam Nabil 2011 - 2012

Introduction

Introduction

Using an image of rice grains, this example illustrates how you can enhance an image to correct for nonuniform illumination, then use the enhanced image to identify individual grains.

Step 1: Read and Display the ImageStep 2: Use Morphological Opening to Estimate the BackgroundStep 3: Subtract Background Image from Original ImageStep 4: Increase the Image ContrastStep 5: Threshold the Image

Procedural steps:

Application:

Page 3: Automation and Drives SIMATIC HMI The Human Machine Interface for internal use only Scope of Presentation Dept. of Industrial Electronics and Control Eng.

Automation and Drives

SIMATIC HMIThe Human Machine Interface

for internal use only

Scope of Presentation

Dept. of Industrial Electronics and Control Eng.Faculty of Electronic Engineering

Use Morphological

Opening to Estimate the

Background

Read The Image

Introduction

Threshold the Image

Subtract Background

Image from Original

Image

Questions and

DiscussionMinoufiya University

Increase the Image

Contrast

Eng./ Essam Nabil 2011 - 2012

Step 1: Read and Display The Image

Read The Image

I = imread('filename.fmt') :reads a grayscale or color image specified by filename and format fmt and stores it into array variable I. If the file is not in the current folder, or in a folder on the MATLAB path, specify the full pathname as:

I = imread(‘D:\pictures\asd.jpg’)

1.1 Key Commands:

figure :creates a new figure object using default property values, and automatically becomes the current figure until a new figure is either created or called.

imshow(I) :displays the stored image of the variable array I.

title('string') :adds the title specified by ‘string’ at the top and in the center of the current axes or figure.

Page 4: Automation and Drives SIMATIC HMI The Human Machine Interface for internal use only Scope of Presentation Dept. of Industrial Electronics and Control Eng.

Automation and Drives

SIMATIC HMIThe Human Machine Interface

for internal use only

Scope of Presentation

Dept. of Industrial Electronics and Control Eng.Faculty of Electronic Engineering

Use Morphological

Opening to Estimate the

Background

Read The Image

Introduction

Threshold the Image

Subtract Background

Image from Original

Image

Questions and

DiscussionMinoufiya University

Increase the Image

Contrast

Eng./ Essam Nabil 2011 - 2012

Step 1: Read and Display The Image

I = imread('rice.png');

figure, imshow(I)

Read in the ‘rice.png' image and bring its data to workspace.

1.2 Step application:

Read The Image

Page 5: Automation and Drives SIMATIC HMI The Human Machine Interface for internal use only Scope of Presentation Dept. of Industrial Electronics and Control Eng.

Automation and Drives

SIMATIC HMIThe Human Machine Interface

for internal use only

Scope of Presentation

Dept. of Industrial Electronics and Control Eng.Faculty of Electronic Engineering

Use Morphological

Opening to Estimate the

Background

Read The Image

Introduction

Threshold the Image

Subtract Background

Image from Original

Image

Questions and

DiscussionMinoufiya University

Increase the Image

Contrast

Eng./ Essam Nabil 2011 - 2012

2.1 Preface:

Notice that the background illumination is brighter in the center of the image than at the bottom. Use imopen to estimate the background illumination.

Use Morphological

Opening to Estimate

the Background

Step 2: Estimate the Background

2.2 Key Commands:

IM2 = imopen(IM,SE) performs morphological opening on the grayscale or binary image IM with the structuring element SE.

background =imopen(I,strel('disk',15));

2.3 Step application:

Page 6: Automation and Drives SIMATIC HMI The Human Machine Interface for internal use only Scope of Presentation Dept. of Industrial Electronics and Control Eng.

Automation and Drives

SIMATIC HMIThe Human Machine Interface

for internal use only

Scope of Presentation

Dept. of Industrial Electronics and Control Eng.Faculty of Electronic Engineering

Use Morphological

Opening to Estimate the

Background

Read The Image

Introduction

Threshold the Image

Subtract Background

Image from Original

Image

Questions and

DiscussionMinoufiya University

Increase the Image

Contrast

Eng./ Essam Nabil 2011 - 2012

Use Morphological

Opening to Estimate

the Background

Step 2: Estimate the Background

Page 7: Automation and Drives SIMATIC HMI The Human Machine Interface for internal use only Scope of Presentation Dept. of Industrial Electronics and Control Eng.

Automation and Drives

SIMATIC HMIThe Human Machine Interface

for internal use only

Scope of Presentation

Dept. of Industrial Electronics and Control Eng.Faculty of Electronic Engineering

Use Morphological

Opening to Estimate the

Background

Read The Image

Introduction

Threshold the Image

Subtract Background

Image from Original

Image

Questions and

DiscussionMinoufiya University

Increase the Image

Contrast

Eng./ Essam Nabil 2011 - 2012

Subtract Background

Image from Original

Image

Step 3: Subtract Background from Original

3.1 Preface:

Notice that the background illumination is brighter in the center of the image than at the bottom. Use imopen to estimate the background illumination.

I2 = I – background;

figure, imshow(I2);

3.2 Step application:

I2 = imsubtract(I,background);

figure, imshow(I2);

OR

Page 8: Automation and Drives SIMATIC HMI The Human Machine Interface for internal use only Scope of Presentation Dept. of Industrial Electronics and Control Eng.

Automation and Drives

SIMATIC HMIThe Human Machine Interface

for internal use only

Scope of Presentation

Dept. of Industrial Electronics and Control Eng.Faculty of Electronic Engineering

Use Morphological

Opening to Estimate the

Background

Read The Image

Introduction

Threshold the Image

Subtract Background

Image from Original

Image

Questions and

DiscussionMinoufiya University

Increase the Image

Contrast

Eng./ Essam Nabil 2011 - 2012

Increase the Image

Contrast

Step 4: Increase the Image Contrast

I3 = imadjust(I2);

figure, imshow(I3);

4.1 Step application:

Page 9: Automation and Drives SIMATIC HMI The Human Machine Interface for internal use only Scope of Presentation Dept. of Industrial Electronics and Control Eng.

Automation and Drives

SIMATIC HMIThe Human Machine Interface

for internal use only

Scope of Presentation

Dept. of Industrial Electronics and Control Eng.Faculty of Electronic Engineering

Use Morphological

Opening to Estimate the

Background

Read The Image

Introduction

Threshold the Image

Subtract Background

Image from Original

Image

Questions and

DiscussionMinoufiya University

Increase the Image

Contrast

Eng./ Essam Nabil 2011 - 2012

Threshold the Image

5.1 Preface:Create a new binary image by thresholding the adjusted

image.

level = graythresh(I3);

bw = im2bw(I3,level);

figure, imshow(bw);

5.2 Step application:

Step 5: Threshold the Image

Page 10: Automation and Drives SIMATIC HMI The Human Machine Interface for internal use only Scope of Presentation Dept. of Industrial Electronics and Control Eng.

Automation and Drives

SIMATIC HMIThe Human Machine Interface

for internal use only

Scope of Presentation

Dept. of Industrial Electronics and Control Eng.Faculty of Electronic Engineering

Use Morphological

Opening to Estimate the

Background

Read The Image

Introduction

Threshold the Image

Subtract Background

Image from Original

Image

Questions and

DiscussionMinoufiya University

Increase the Image

Contrast

Eng./ Essam Nabil 2011 - 2012

Questions and Discussion

Questions and Discussion