Keywords: front-page

## Lab: Area Distribution

[Exercises] [Workspace]

Purpose: The purpose of this lab exercise is to experiment with a few basic feature extraction and image analysis techniques. This lab focuses on determination of the area distribution of cells in an image using labeling and histogram operations.

Activities:

1. Determine the area distribution of cells in the $DIP/data/blobs.kdf image based on the area of each cell. Use labeling and histogram techniques for this exercise.

   1. Read and display the image $DIP/data/blobs.kdf. Use operators User defined and Display Image:

      1. Glyphs:Input/Output:Data Files:User defined
      2. Glyphs:Visualization:Non-Interactive Display:Display Image
      3. Run to display the image

   2. Label the image and display it. Use the Labeling (mmach) operator of the MMACH toolbox. After labeling, each region will have a unique grey-level value.

      1. Glyphs:MMACH:Connected Filters:Labeling (mmach) (mmach)
      2. Connect the output of User defined to the input of Labeling (mmach) (mmach).
      3. Duplicate the Display Image operator from step A and connect the output of Labeling (mmach) (mmach) to the input of Display Image.
      4. Run this sequence

   3. Use the Statistics operator to determine the maximum pixel value. This gives the total number of regions in the image.

      1. Glyphs:Data Manip:Analysis & Information:Statistics
      2. Glyphs:Input/Output:Information:File Viewer
      3. Connect the ASCII output of the Statistics operator to the File Viewer.
      4. Run these operators to determine the maximum pixel value.

   4. Calculate and plot the Histogram of the labeled image.

      1. Glyphs:Data Manip:Histogram Operators:Histogram
      2. Glyphs:Visualization:Plot Display:Display 2D Plot
      3. For the Histogram operator, use a "Bin width" of 1 and set the "Number of bins" to the number of regions determined by the Labeling (mmach) operator. Since the background region (grey-level value 0) has an area much larger than the other regions, and since the background information should not be included in this analysis, calculate the histogram starting from 1 ("Minimum") to the total number of regions.
      4. Connect the output of Labeling (mmach) (mmach) to the input of Histogram.
      5. Connect the output of Histogram to the input of Display 2D Plot.
      6. Run the cantata network, and observe the maximum value along the vertical axis in the plot (set the "Plot Type" to "Discrete"). This is the region with the largest area.

   5. Calculate the Histogram of the histogram.

      1. Duplicate the Histogram operator from step D.
      2. Glyphs:Input/Output:Information:Print Data
      3. Glyphs:Input/Output:Information:File Viewer
      4. Set up the Histogram operator to use a "Bin width" of 400, and set "Number of bins" to 4. This will allow you to group the regions into four different categories.
      5. Connect the output of the first Histogram operator to the second Histogram operator
      6. Connect the output of the second Histogram operator to Print Data and the output of that to File Viewer.
      7. Running this part of the network will print the contents of the histogram using Print Data. Interpret the meaning of this table.

Exercises

1. Experiment with the parameters "Bin width" and "Number of bins" in the Histogram operator. Varying these parameters will allow you to group the regions into different categories.
2. Experiment with the "Connectivity" parameter of the Labeling (mmach) operator. What will this do?

Khoros Workspace
Execute the visual program c2s13label-histo-histo.wk