[MATLAB] Image binarization (imbinarize function)

Hits: 0

[ [MATLAB] ] Image binarization (imbinarize function)

Image [Binarization] Hint in MATLAB 2019: It is recommended to use ‘imbinarize’ instead of ‘im2bw’. So I specially summarize the usage of im2bw and imbinarize. The ‘im2bw’ function is not recommended since R2016a, as shown below: The
MATLAB code is as follows:

% old im2bw
srcImage = imread('Original image.jpg');
% Determine the binarization threshold
thresh = graythresh(srcImage);
% Binary image
dstImage = im2bw(srcImage,thresh);

% new version imbinarize
srcImage = imread('Original image.jpg');
% Binary image
dstImage = binarize(srcImage);

You may also like...

Leave a Reply

Your email address will not be published.