ECE 280/Imaging Labs

From PrattWiki
Revision as of 04:03, 12 August 2020 by DukeEgr93 (talk | contribs)
Jump to navigation Jump to search

This page serves as a supplement to the Digital Image Processing Labs for ECE 280. It has been updated for the Fall 2020 semester, including providing instructions for working on labs remotely.

Running MATLAB

MATLAB can be run remotely on the Duke Linux system, but it will generally be more convenient for you to install it on your own computer.

Installing MATLAB

MATLAB is free for Duke students. Follow the instructions in the Installation section of the EGRWiki page on MATLAB. Be sure to select the appropriate PRODUCTS when asked.

Using MATLAB Remotely

If you do not want to install MATLAB, you can use Duke's installation. You will first need to connect to the Duke Linux system using either MobaXterm (Windows) or XQuartz (macOS), making sure you correctly issues the ssh command to get graphics. Then simply type matlab & to start MATLAB. More information is available at the page How To Get Work Done

Image Processing Toolbox

The following will take you through several examples from the MATLAB Image Processing Toolbox. Along the way you will learn about different types if images, how they are stored and saved, and what you can do with them in MATLAB. Open the Add-On Explorer, search for Image Processing, and complete the following:

Overview Tab

Read the overview. Several of the terms may be meaningless to you at the moment.

Learn More Button

On the right of the Explorer screen, there is a Learn More box; click that to go to the Image Processing Toolbox web page. Watch the video (~2 minutes). Once that is done, you can close that page and go back to the Add=On Explorer.

Open Documentation Button

Also on the right of the Explorer screen, there is an Open Documentation button; click that to open the toolbox documentation. You will be going through several sections of this documentation.

Get Started with the Image Processing Toolbox

In the Tutorials section of this page, go through Basic Image Import, Processing, and Export. By the end of it, you will have used several basic commands: imread, imshow, whos, figure, imhist, histeq, imwrite, and iminfo. You will see more details about these as you go along. Once done, go back to the Get Started page.

Next, in the About Image Processing section, go through Image Types in the Toolbox. There are 7 different types of images listed but we will only concern ourselves with the first four: binary, indexed, grayscale, and truecolor. Read through the descriptions of each along with the following accompaniment:

  • Binary images only have two values (0/1, False/True, Off/On). They store the least amount of information but can certainly still be useful.
  • Indexed images are basically electronic "paint by numbers." Each pixel is given an integer value, and that integer value refers to a row in a lookup table that contains the amount of red, green, and blue with which to color that pixel. In the example, anything mapped to a 4 would be pure blue since the fourth row of the color map yields [0, 0, 1].
  • Grayscale images will have a range of brightness values - either a float in the range of 0 to 1 or an unsigned integer in the range of 0 to 255.