Please explain the following line

1 回表示 (過去 30 日間)
Sahil khandelwal
Sahil khandelwal 2022 年 5 月 22 日
コメント済み: DGM 2022 年 5 月 22 日
Its about threshold segmentation.
th=t0+((max(inp(:))+min(inp(:)))./2);

回答 (2 件)

DGM
DGM 2022 年 5 月 22 日
Without any context, all anyone can give is an answer without context.
min(inp(:)) % this is the global minimum of inp
max(inp(:)) % this is the global maximum of inp
((max(inp(:)) + min(inp(:)))./2 % this is the average of the extrema of inp
So then this is the average of the extrema of inp, plus t0 -- whatever that means
th = t0 + ((max(inp(:)) + min(inp(:)))./2);

Image Analyst
Image Analyst 2022 年 5 月 22 日
The stuff between the parentheses is the midpoint of the histogram. My guess is that they have an image with a narrow histogram and they're trying to threshold it a certain number of gray levels above the mean or peak gray level. It might be better to use a triangle threshold, like the attached utility.

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by