Normalized Threshold Value in Image Segmentation

2 次查看(过去 30 天)
In 'BlobsDemo.m' file, why normalized threshold value is needed?
% normalizedThresholdValue = 0.4; % In range 0 to 1.
% thresholdValue = normalizedThresholdValue * max(max(originalImage)); % Gray Levels.

回答(1 个)

PBM
PBM 2020-5-18
I am a novice/beginner at Image Processing; and I did the blobs demo myself only several days ago --- but I will share how I interpreted it. That line of code assumes that at 40% of the maximum Gray Level available in the image, you should be able to find that at less than that Gray Level, most or all of the background pixels will be there, and at greater than that level most of the foreground pixels will be there. This determination could have been made by creating a histrogram for the image (0-255 as Gray levels: each gray Level shows how many pixels in that gray level in Y-Axis). Since the image had two main regions (pixels with graylevels from coins, and the fairly uniform background)... a separting line on the x axis between the two 'bins' could be found at about 40% of the max threshold value (of course in this scenario, one could also opt to just read the graph and write the actual threshold value, but maybe a % number is better code for applying to a more images of this type)

Community Treasure Hunt

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

Start Hunting!

Translated by