2D Histogram

From MIPAV
Jump to: navigation, search

The 2D Histogram algorithm takes as an input, two grayscale images or one color image to create a 2D histogram image based on the data in two input images.

Background

The active image window is the source image whose frequency values are placed along the x-axis of the 2D histogram image. The second image forms the base image whose frequency values are placed along the y-axis of the 2D histogram image.

If the color image is an input to the algorithm, the user must select which two color channels should be used for processing.

The user has the option to linearly rescale the second image for both grayscale and color images. If true, the range of data in second image is rescaled to be the same as the range of data in the first image. In other words, the second image minimum is rescaled to the first image minimum and the second image maximum is rescaled to the first image maximum. Also, if linear rescaling is used the number of bins in the second image is set equal to the number of bins in the first image.

  • The default number of bins equals the minimum of 256 and (max. value - min. value 1) if the data is not float.
  • If the data is float or double the default number of bins is set to 256.

The processing of maximum values is specially handled to prevent loss of top bin counts from rounding errors.

The user has the option to calculate the log of result image for better visualization.

[2dHistogram.html#wp1556615 Figure 10] shows the two input images, the output 2D histogram image and its lookup table.

Figure 1. Two input images, output 2D histogram image and its lookup table

2D HistogramImage1.png

2D HistogramImage2.png

2D HistogramImage1 2.png

2D HistogramImage12LUT.png

Image types

You can apply this algorithm to both color and black-and-white images, as well as 2D and 3D images.

Notes

No notes.

Applying the 2D Histogram algorithm to grayscale images

  1. Select Algorithms > Histogram Tools > 2D Histogram in the main MIPAV window. The Histogram Two Dimensional dialog box appears.
  2. Select the base image from the drop-down list.
  3. Check the Linearly rescale 2nd image checkbox if you want to rescale the 2-nd image. By default, the box is checked.
  4. Enter the appropriate bin number for Image1 and Image2. The default value for both images is 256.
  5. Check the Calculate log of the result image checkbox if you want to calculate the log of the result image for better visualization. By default, the box is checked. Refer to [2dHistogram.html#wp1556231 Figure 9] for details.
Figure 2. The Histogram Two Dimensional dialog box for grayscale images
Histogram 2D with <File name> to:
Select the base image from the list box.
Options
Linearly rescale 2-nd image
Use this checkbox if you want to rescale the 2-nd image. By default, the box is checked.
2DHistogram two dim.png
Image 1 bin format
Enter the bin number for the image 1. The default value is 256.
Image 2 bin format
Enter the bin number for the image 2. The default value is 256.
Calculate the log of the result image
Check if you want to calculate the log of the result image for better visualization. By default, the box is checked.
OK
Applies the algorithm according to the specifications in this dialog box.
Cancel
Disregards any changes that you made in the dialog box and closes this dialog box.
Help
Displays online help for this dialog box.


  1. Click OK. The algorithm begins to run, and a progress bar appears momentarily with the status. When the algorithm finishes running, the progress bar disappears, and the results appear in a separate image window.

Applying the 2D Histogram algorithm to color images

To run this algorithm for color images, complete the following steps:

  1. Select Algorithms > Histogram tools > 2D Histogram.
  2. Use the checkbox to select any two colors from red, green, and blue. Note that, only two colors can be selected.
  3. Check the Linearly rescale 2nd image checkbox if you want to rescale the 2-nd image. By default, the box is checked.
  4. Enter the appropriate bin number for the two colors selected. The default values is 256 for both colors.
  5. Check the Calculate log of the result image checkbox if you want to calculate the log of the result image for better visualization. By default, the box is checked.
  6. Click OK. See [2dHistogram.html#wp1556615 Figure 10].

The algorithm begins to run, and the pop-up window appears to run with the status. The following message appears: "Processing Image". When the algorithm is completed the pop-up window closes and the 2D histogram image appears in the new window.

Figure 3. The Histogram Two Dimensional dialog box for color images
Select 2 of 3 colors
Use the checkbox to select any two colors from red, green, and blue. Note that, only two colors can be selected.
2DHistogram color.png
Options
Linearly rescale
Use this checkbox if you want to rescale the 2-nd color. By default, the box is checked.
Color 1 bin number
Enter the bin number for color 1. The default value is 256.
Color 2 bin number
Enter the bin number for color 2. The default value is 256.
Calculate the log of the result image
Check if you want to calculate the log of the result image for better visualization. By default, the box is checked.
OK
Applies the algorithm according to the specifications in this dialog box.
Cancel
Disregards any changes that you made in the dialog box and closes this dialog box.
Help
Displays online help for this dialog box.