Commit f0fc324f authored by Julius Hossain's avatar Julius Hossain

Matlab binarization code updated

parent e20e9afc
Pipeline #10158 passed with stage
in 42 seconds
```matlab
function src_binarize_image()
%This function illustrates separating foreground from background using a
%fixed threshold value
threshold = 50; %example hreshold value
%This scripts illustrates separating the foreground from the background
%using a threshold value provided by the user
%Prompt user for a threshold value
thres_val = input('Enter a threshold 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
%Binarize input image with the threshold valuein_image
bin_image = uint8(in_image>= thres_val);
figure; imagesc(bin_image) % Display binary image
```
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