diff --git a/code/src_binarize_image.m b/code/src_binarize_image.m new file mode 100644 index 0000000000000000000000000000000000000000..c240366c5feeb63a11a97d8edfed4e2a60494f72 --- /dev/null +++ b/code/src_binarize_image.m @@ -0,0 +1,13 @@ +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 + diff --git a/modules/image-binariztion.md b/modules/image-binariztion.md index 883d449577da686fea2958af4746734a1d7bbbbb..aed7d430133a17107d74a9572798c97f55905ef2 100644 --- a/modules/image-binariztion.md +++ b/modules/image-binariztion.md @@ -12,16 +12,3 @@ binaryimage -> 1 [label=" foreground"]; } '/> - -