I need to count cell nucleus in these images how can I do that
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Can I get a code in image processing field to count the cells’ nucleus from these photos
0 comentarios
Respuestas (1)
Vinayak Agrawal
el 15 de Jun. de 2023
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 comentario
Image Analyst
el 15 de Jun. de 2023
The histogram equalization step is not needed. It is almost never needed in any situation.
Ver también
Categorías
Más información sobre Biomedical Imaging en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!