Thresholding Tool

バージョン 1.6.0.1 (6.21 KB) 作成者: Robert Bemis
Interactively select intensity level for image thresholding.
ダウンロード: 19.6K
更新 2016/9/1

ライセンスの表示

編集メモ: This file was selected as MATLAB Central Pick of the Week

THRESH_TOOL launches a GUI (graphical user interface) for thresholding an intensity input image, IM. IM is displayed in the top left corner. A colorbar and IM's histogram are displayed on the bottom. A line on the histogram indicates the current threshold level. A binary image is displayed in the top right based on the selected level. To change the level, click and drag the line. The output image updates automatically.
There are two ways to use this tool.

Mode 1 - nonblocking behavior:
THRESH_TOOL(IM) launches GUI tool. You can continue using the MATLAB Desktop.Since no results are needed, the function does not block execution of other commands.

THRESH_TOOL(IM,CMAP) allows the user to specify the colormap, CMAP. If not specified, the default colormap is used.

THRESH_TOOL(IM,CMAP,DEFAULTLEVEL) allows the user to specify the default threshold level. If not specified, DEFAULTLEVEL is determined by GRAYTHRESH. Valid values for DEFAULTLEVEL must be consistent with the data type of IM for integer intensity images: uint8 [0,255], uint16 [0,65535], int16 [-32768,32767].

Example
x = imread('rice.png');
thresh_tool(x)
%no return value, so MATLAB keeps running

Mode 2 - blocking behavior:
LEVEL = THRESH_TOOL(...) returns the user selected level, LEVEL, and MATLAB waits for the result before proceeding. This blocking behavior mode allows the tool to be inserted into an image processing algorithm to support an automated workflow.

[LEVEL,BW] = THRESH_TOOL(...) also returns the thresholded binary output image, BW.

Example
x = imread('rice.png');
lev = thresh_tool(x) %MATLAB waits for GUI tool to finish

See also colormap, graythresh, im2bw.

引用

Robert Bemis (2024). Thresholding Tool (https://www.mathworks.com/matlabcentral/fileexchange/6770-thresholding-tool), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R14
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
謝辞

ヒントを得たファイル: hline and vline

ヒントを与えたファイル: Demos from Image Processing Webinar 2006, Cell_area, Manual Thresholding Tool

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.6.0.1

Updated license

1.6.0.0

ZIP file corrected

1.4.0.0

copyright

1.3.0.0

Added graceful error message if input not intensity image as required.

1.1.0.0

Fix thumbnail for animated GIF

1.0.0.0