EGR 111 Image Processing

Similar documents
Digital Image processing Lab

Image processing in MATLAB. Linguaggio Programmazione Matlab-Simulink (2017/2018)

Lab 1. Basic Image Processing Algorithms Fall 2017

A PROPOSED ALGORITHM FOR DIGITAL WATERMARKING

CS/NEUR125 Brains, Minds, and Machines. Due: Wednesday, February 8

Lecture 1: Introduction to Matlab Programming

EELE 5110 Digital Image Processing Lab 02: Image Processing with MATLAB

Exercise NMCGJ: Image Processing

ECE 619: Computer Vision Lab 1: Basics of Image Processing (Using Matlab image processing toolbox Issued Thursday 1/10 Due 1/24)

MATLAB Image Processing Toolbox

Brief Introduction to Vision and Images

L2. Image processing in MATLAB

DSP First Lab 06: Digital Images: A/D and D/A

Advanced Masking Tutorial

MATLAB 6.5 Image Processing Toolbox Tutorial

Matlab for CS6320 Beginners

Transform. Processed original image. Processed transformed image. Inverse transform. Figure 2.1: Schema for transform processing

Lab P-8: Digital Images: A/D and D/A

EE/GP140-The Earth From Space- Winter 2008 Handout #16 Lab Exercise #3

International Journal of Advance Engineering and Research Development. Implementation of Digital Image Basic and Editing functions using MATLAB

MATLAB DEMONSTRATIONS

Image Processing. Chapter(3) Part 2:Intensity Transformation and spatial filters. Prepared by: Hanan Hardan. Hanan Hardan 1

Index of Command Functions

Example Homework Solution

Chapter 4 MASK Encryption: Results with Image Analysis

Excel Lab 2: Plots of Data Sets

INTRODUCTION TO IMAGE PROCESSING

Page 1/10 Digilent Analog Discovery (DAD) Tutorial 6-Aug-15. Figure 2: DAD pin configuration

Pixilation and Resolution name:

The BIOS in many personal computers stores the date and time in BCD. M-Mushtaq Hussain

EGR 111 Audio Processing

Image Enhancement in the Spatial Domain Low and High Pass Filtering

LAB 2: Sampling & aliasing; quantization & false contouring

MatLab for biologists

All Creative Suite Design documents are saved in the same way. Click the Save or Save As (if saving for the first time) command on the File menu to

Using Curves and Histograms

Chapter 0 Getting Started on the TI-83 or TI-84 Family of Graphing Calculators

Experiment 1 Introduction to MATLAB and Simulink

ENEE408G Multimedia Signal Processing

IMAGE PROCESSING: POINT PROCESSES

EP375 Computational Physics

Sharpening Spatial Filters ( high pass)

Introduction to DSP ECE-S352 Fall Quarter 2000 Matlab Project 1

Instruction Manual. Mark Deimund, Zuyi (Jacky) Huang, Juergen Hahn

Princeton ELE 201, Spring 2014 Laboratory No. 2 Shazam

Color and More. Color basics

Getting Started With The MATLAB Image Processing Toolbox

IT154 Midterm Study Guide

UNIVERSITY OF UTAH ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT

We are IntechOpen, the world s leading publisher of Open Access books Built by scientists, for scientists. International authors and editors

Recovering highlight detail in over exposed NEF images

DIGITAL IMAGE PROCESSING Quiz exercises preparation for the midterm exam

Brief introduction Maths on the Net Year 2

Enhancement of Multispectral Images and Vegetation Indices

Histogram and Its Processing

5 Masks and Channels

Remote Sensing 4113 Lab 08: Filtering and Principal Components Mar. 28, 2018

5.1 Image Files and Formats

CS 200 Assignment 3 Pixel Graphics Due Tuesday September 27th 2016, 9:00 am. Readings and Resources

Chapter 4. Incorporating Color Techniques

Histogram and Its Processing

Session 3: Getting to Know Photoshop Elements. Keep in mind that there are many others ways of solving the problems.

Lab 4 Projectile Motion

The 2 in 1 Grey White Balance Colour Card. user guide.

A Basic Guide to Photoshop Adjustment Layers

Selective Edits in Camera Raw

The KolourPaint Handbook. Thurston Dang, Clarence Dang, and Lauri Watts

The student will: download an image from the Internet; and use Photoshop to straighten, crop, enhance, and resize a digital image.

Using Adobe Photoshop

2. Color spaces Introduction The RGB color space

6.098/6.882 Computational Photography 1. Problem Set 1. Assigned: Feb 9, 2006 Due: Feb 23, 2006

Image Processing Toolbox. Matlab

Duplicate Layer 1 by dragging it and dropping it on top of the New Layer icon in the Layer s Palette. You should now have two layers rename the top la

Computer Exercises in. Communication Theory SMS016

INTRODUCTION TO CCD IMAGING

Lab for Working with Adobe Photoshop

Play with image files 2-dimensional array matrix

Color each numeral card. Count the objects in each group. Then color the group of objects the same color as the numeral card that it matches.

How to Create Website Banners

Statistics 101: Section L Laboratory 10

Exercise 4-1 Image Exploration

Introduction to Color Theory

IMAGE PROCESSING Vedat Tavşanoğlu

Adobe Photoshop CS5 Layers and Masks

Try what you learned (and some new things too)

4/9/2015. Simple Graphics and Image Processing. Simple Graphics. Overview of Turtle Graphics (continued) Overview of Turtle Graphics

Sante FFT Imaging Copyright 2018 Santesoft, all rights reserved

Table of Contents 1. Image processing Measurements System Tools...10

In the following sections, if you are using a Mac, then in the instructions below, replace the words Ctrl Key with the Command (Cmd) Key.

Laser Engraver. User Manual

Experiments #6. Convolution and Linear Time Invariant Systems

Motion Detection Keyvan Yaghmayi

How to use advanced color techniques

How to use advanced color techniques

A Basic Guide to Photoshop CS Adjustment Layers

Photoshop Elements 3 Brightness and Contrast

June 30 th, 2008 Lesson notes taken from professor Hongmei Zhu class.

Eight Queens Puzzle Solution Using MATLAB EE2013 Project

Properties Range% - Minutes - Restart - Box Size Initial % -

Lesson 15: Graphics. Introducing Computer Graphics. Computer Programming is Fun! Pixels. Coordinates

Transcription:

EGR 111 Image Processing This lab shows how MATLAB can represent and manipulate images. New MATLAB Commands: imread, imshow, imresize, rgb2gray Resources (available on course website): secret_image.bmp 1. Loading and Displaying Grayscale Images A grayscale image (also called a black and white image) is represented in MATLAB by a two-dimensional matrix. Each element in the matrix indicates the brightness of a pixel in the image. (Pixel is short for picture element.) The higher the pixel value, the brighter or whiter the pixel appears in the image. Many images use 8-bit numbers to represent the pixel brightness, in which case the pixel values range from 0 (black) to 255 (white), and numbers in between appear as shades of gray. MATLAB includes several sample images. In this section we will load and display one of these files called moon.tif. 1. Load the image file moon.tif, which is installed with MATLAB, using the following command: I = imread('moon.tif'); 2. Display the image: figure(1), title('original image') 3. Find the size of the image by typing: size(i) MATLAB should display two numbers like: ans = 537 358. The first number is the number of rows and the second number is the number of columns. 4. View some of the image values from the upper-left hand corner of the image: I(1:10,1:10) Note that these values are small (compared to 255), which indicates that the pixels in the upper left-hand corner are dark. EGR111 - p. 1 of 7 - Image Processing_rev2.docx

5. Click on the Data Cursor button in the figure window, and click on a dark area in the image (see the figure below). The value of "Index" is the value of the pixel (0 for black, 255 for white). The value of "X" is the x-axis value (which is the column number in the matrix) and the value of "Y" is the y-axis value (which is the row number of the pixel in the matrix). Data Cursor EGR111 - p. 2 of 7 - Image Processing_rev2.docx

2. Manipulating Grayscale Images MATLAB makes it easy to manipulate the image. First let's make a copy of the image. I2 = I; We can access the value of the pixel in the 10 th row and 4 th column by typing the following. I2(10,4) The value of the pixel in the 10 th row and 4 th column should be 3, which is the same as the Index value shown in the Data Cursor in the figure (see the figure above). We can change the pixel in the 10 th row and 4 th column to white by typing the following: I2(10,4) = 255; You should now see a white dot in the upper left hand corner of the image. You may need to zoom in to see it. Note that the image in the figure window is updated only when you type the imshow command, not when you change the values in the matrix. We can make a horizontal white line by replacing an entire row with white pixels. I2(100,:) = 255; Recall that when using the colon operator to index matrices, the colon by itself means all of the rows or all of the columns. We can brighten the image by adding a constant to every element: I2 = I + 100; Compare the two images (original and brightened) side-by-side. Invert the image (convert light areas to dark and vice versa) as follows: I2 = 255 - I; EGR111 - p. 3 of 7 - Image Processing_rev2.docx

Two images can be superimposed by adding the matrices as follows. I2 = imread('liftingbody.png'); I2 = imresize(i2, size(i)); I3 = I + I2; figure(3) imshow(i3) A color image can be converted to grayscale as follows. I4 = imread('onion.png'); figure(4) imshow(i4) I5 = rgb2gray(i4); figure(5) imshow(i5) Exercise 1: Load an image of your choice into MATLAB, make some changes to it, and display the original image and the changed image. You can use your own image, or if you want, you can use one of the MATLAB sample images listed below. bag.png coins.png concordorthophoto.png liftingbody.png rice.png testpat1.png westconcordorthophoto.png AT3_1m4_01.tif cameraman.tif cell.tif circuit.tif eight.tif forest.tif kids.tif moon.tif mri.tif pout.tif shadow.tif spine.tif tire.tif trees.tif Checkpoint 1: Show your instructor the original and modified images from Exercise 1. EGR111 - p. 4 of 7 - Image Processing_rev2.docx

Exercise 2: Download the file secret_image.bmp from the course website and display the image. This image has been purposely modified in an attempt to conceal a hidden image. First the pixel values were all divided by 10, so the range of the data was reduced to the range 0 to 26. Then the value 200 was added to about half of the pixels which were selected at random. This processing covers the original image with random noise, however, it is possible to remove the processing and recover the original image. The pixels that were randomly selected will have values greater than 26, so in order to recover the original image, a program needs to check each pixel value, and for those pixels that have a value greater than 26, the program should subtract 200. Then the program should multiply all pixel values by 10. Write a script file that loads secret_image.bmp, recovers the original image, and displays the result. Checkpoint 2: Show your instructor your script file and the recovered image from Exercise 2. OPTIONAL Exercises. The optional exercises below show how to manipulate color images. MATLAB can also load and display color images. Type the following commands to load the image file onion.png which is a MATLAB example image: I=imread('onion.png'); ; A color image is composed of three separate images, one for the intensity of red, one for green, and one for blue. You can see that MATLAB represents this color image by a three dimensional matrix by typing the following command: size(i) The size of this image is 135 by 198 by 3. There are 135 rows, 198 columns, and 3 colors (red, green, and blue). You can display each of the 3 images separately using the following commands: figure; imshow(i(:,:,1)), title('red') figure, imshow(i(:,:,2)), title('green') figure, imshow(i(:,:,3)); title('blue') Note that the white onion appears fairly bright in all three images because white is composed of red, green, and blue. The red pepper appears fairly bright in the red image, but dark in the green and blue images. The yellow pepper appears bright in the red and green images because yellow is made up of a mixture of red and green. EGR111 - p. 5 of 7 - Image Processing_rev2.docx

You can generate images with various colors by making matrices with different values for each of the three images. For example, to make an 8-bit image with 100 by 100 pixels where all the pixels are black, you set all the values to zero as follows: You can make an image with all red pixels by setting the first color value to the maximum value of 255 as follows: I(:,:,1) = 255; The following commands generate an image with all green pixels by setting the second color value to the maximum value of 255 as follows: I(:,:,2) = 255; And a blue image can be generated as follows: I(:,:,3) = 255; You can add different amounts of the primary colors (red, green, and blue) to get other colors. For example, it you mix red and green you get yellow. I(:,:,1) = 255; I(:,:,2) = 255; Make an image where all three primary colors are added together (red, green, and blue). What is the resulting color? Load the image file onion.png as shown above and make a yellow stripe across the image. One way to change the colors in an image is to swap the images from two of the colors. For example, the commands below swap the red and blue images. I=imread('onion.png'); tmp = I(:,:,1); % save red image in a temporary variable I(:,:,1) = I(:,:,3); % put blue image into red I(:,:,3) = tmp; % put red image into blue, EGR111 - p. 6 of 7 - Image Processing_rev2.docx

Optional Exercise 3: Write a script file to load an image of your choice, make modifications to the image to make it more interesting, and display the result. Optional Checkpoint 3: Show your instructor the original and modified images from Exercise 3. EGR111 - p. 7 of 7 - Image Processing_rev2.docx