Commit d935c771 authored by Julius Hossain's avatar Julius Hossain

scr_binarize_image.m added

parent fb083e7f
function src_binarize_image()
%This function illustrates separating foreground from background using a
%fixed threshold value
threshold = 50; %example hreshold value
%Read input image
in_image = imread(['image_data' filesep 'xy_8bit__two_cells.tif']);
figure; imagesc(in_image); %display input image
%Binarized input image with the threshold value;
bin_image = uint8(in_image>= threshold);
figure; imagesc(bin_image) % display binary image
end
......@@ -12,16 +12,3 @@
binaryimage -> 1 [label=" foreground"];
}
'/>
<img src='https://g.gravizo.com/svg?
digraph G {
shift [fontcolor=white,color=white];
![Figure 1-1](images/xy_8bit__two_cells.tif "Figure 1-1") -> threshold;
threshold -> background [label=" <threshold"];
threshold -> foreground [label=" >=threshold"];
background -> binaryimage;
foreground -> binaryimage;
binaryimage -> 0 [label=" background"];
binaryimage -> 1 [label=" foreground"];
}
'/>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment