How to imbinarize Cell nucleus
4 views (last 30 days)
Pratyush Roy on 10 May 2021
Firstly you can convert the RGB image to a grayscake image using the method rg2gray/ After this, you can use imbinarize with a threshold for converting grayscale image to binary image. The code snippet below illustrates how to obtain the cell nucleus:
cell_img = imread("cell_nucleus.png");
cell_img_gray = rgb2gray(cell_img);
BW = imbinarize(cell_img_gray,0.35); % The threshold is set to a low value of 0.35, so that only the dark purple pixels are obtained as black.
Hope this helps!