I need to count cell nucleus in these images how can I do that

조회 수: 2 (최근 30일)
Asia Najjar
Asia Najjar 2023년 6월 15일
댓글: Image Analyst 2023년 6월 15일
Can I get a code in image processing field to count the cells’ nucleus from these photos

답변 (1개)

Vinayak Agrawal
Vinayak Agrawal 2023년 6월 15일
Hi Asia,
Yes, here is an example code in MATLAB for counting the cells' nucleus from a JPEG photo:
% Load the image
img = imread('cells.jpg');
% Convert the image to grayscale
grayimg = rgb2gray(img);
% Apply a median filter to remove noise
medimg = medfilt2(grayimg);
% Enhance contrast using histogram equalization
equalizedimg = histeq(medimg);
% Segment the image using adaptive thresholding
thresimg = adaptthresh(equalizedimg, 0.3);
binaryimg = imbinarize(equalizedimg, thresimg);
% Remove small objects from the binary image
binaryimg = bwareaopen(binaryimg, 10);
% Find the connected components in the binary image
cc = bwconncomp(binaryimg);
% Count the number of cells' nucleus
nucleusCount = cc.NumObjects;
% Display the results
figure;
subplot(2,2,1); imshow(img); title('Original Image');
subplot(2,2,2); imshow(medimg); title('Grayscale Image with Median Filtering');
subplot(2,2,3); imshow(equalizedimg); title('Contrast Enhanced Image');
subplot(2,2,4); imshow(binaryimg); title(['Detected Nuclei: ', num2str(nucleusCount)]);
You may need to adjust the parameters of the image processing functions and methods used in this code to obtain the desired results for your input image. Also, note that this code assumes a certain level of expertise in image processing and MATLAB programming
Hope it helps
  댓글 수: 1
Image Analyst
Image Analyst 2023년 6월 15일
The histogram equalization step is not needed. It is almost never needed in any situation.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Biomedical Imaging에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by