Gray Value Histogramπ
When opening the tool, the histogram of the image shown in the active graphics window is displayed.
About Gray Value Histogramsπ
- Y-Axis
-
The y-axis represents the frequency of the gray values. For images with multiple channels, the selected channel is displayed (default: channel 1).
-
You can switch between a linear and a logarithmic representation of the values.
- X-Axis
- The x-axis below the histogram represents the gray values in the image. For byte images, the range is always 0β255. For all other image types, for example, real images, the x-axis runs from the minimum to the maximum gray value of the image, and the labeling of the axis is changed accordingly.
- Thresholds
- The threshold operation segments an image using the selected minimum and maximum gray value.
For images with multiple channels, the threshold is applied to the selected channel. - For more information about thresholds, see also the
threshold
operator. - Scales
- The scale operation maps the gray values between the left and the right line to the full range (usually 0β¦255).
The gray values of the image are scaled such that the gray value 0 of the scaled image corresponds to the selected minimum gray value and the gray value 255 to the selected maximum gray value.
For images with multiple channels, scaling is applied to the selected channel. - For more information about scaling, see also the
scale_image
operator. - Code Generation
- The resulting threshold or scale operation is displayed instantly as HSCRIPT code. This allows you to use the resulting code directly in your own scripts.
How to Work With the Toolπ
To get started:
- In the Graphics View, select the image you want to analyze, for example, by double-clicking the corresponding iconic variable.
- On the Tools menu, select Gray Value Histogram.
β If not already open, the histogram opens as a new editor tab.
In the histogram window, you have the following options to change its appearance:
- To switch between linear or logarithmic representation of the values, hover over the histogram, and then select the corresponding option in the drop-down menu at the top of the window.
- To show the initial, entire histogram, hover over the histogram, and then click Reset.
- To zoom into a specific area of the histogram, use the scroll wheel or drag the mouse to adjust the view.
To zoom a single axis, use the scroll wheel on the axis only.
How to Work With Thresholds or Scalesπ
You can use the histogram tool to apply thresholds or scaling interactively.
To apply thresholds or scaling interactively:
- Open the histogram window.
- In the Range Selection and Code Generation area, select Threshold or Scale as needed.
- Enable Visualization.
- In case of multi-channel images, select the channel you want to work with.
-
Drag the sliders to adjust the threshold or scale values as needed.
You can also enter the gray values (values on the x-axis) directly in the Min and Max fields.
How to Use Generated Code From a Threshold or Scale Operationπ
- In the histogram window, configure the threshold or scale operation as described in How to Work With Thresholds or Scales.
β The Generated Code field shows the corresponding HSCRIPT code. -
Do one of the following:
- To copy the generated code to the clipboard, click the button.
-
To insert the code at the current cursor position into your program, click the button.
Note
The editor tab must be visible for the βinsertβ action to work.