Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: cell counting

Subject: cell counting

From: Shree

Date: 27 Feb, 2008 14:19:01

Message: 1 of 4

Could someone help with counting the number of cells that
have been segmented in an image. i have segemented the
cells and marked the outline of each cell. Now i need to
count the number of cells present.

Subject: cell counting

From: Dan

Date: 27 Feb, 2008 16:04:01

Message: 2 of 4


Have you looked at the demos in the image processing
toolbox? They should point you in the right direction. If
you have the cells segmented, you should be able to do
something like use imfill to fill the interiors and then
convert to b&w and finally use regionprops to get stats on
the connected pixels.


"Shree " <sherly2443.nospam@mathworks.com> wrote in message
<fq3rgl$7ra$1@fred.mathworks.com>...
> Could someone help with counting the number of cells that
> have been segmented in an image. i have segemented the
> cells and marked the outline of each cell. Now i need to
> count the number of cells present.

Subject: cell counting

From: Vihang Patil

Date: 27 Feb, 2008 16:07:02

Message: 3 of 4

"Shree " <sherly2443.nospam@mathworks.com> wrote in
message <fq3rgl$7ra$1@fred.mathworks.com>...
> Could someone help with counting the number of cells
that
> have been segmented in an image. i have segemented the
> cells and marked the outline of each cell. Now i need to
> count the number of cells present.

There is a very nice demo in the IMAGE PROCESSING TOOLBOX
for the same

Small ex:
I = imread('coins.png');
imshow(I);
bw = im2bw(I,graythresh(I));
figure,imshow(bw);
bw = imfill(bw,'holes');
figure,imshow(bw);
L = bwlabel(bw);
obj1 = max(max(L))

% OR can use Alternative Code

stats = regionprops(L,'Basic');
obj2 = numel(stats)

HTH
Vihang

Subject: cell counting

From: Shree

Date: 28 Feb, 2008 04:12:02

Message: 4 of 4

"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
<fq41r6$pe7$1@fred.mathworks.com>...
> "Shree " <sherly2443.nospam@mathworks.com> wrote in
> message <fq3rgl$7ra$1@fred.mathworks.com>...
> > Could someone help with counting the number of cells
> that
> > have been segmented in an image. i have segemented the
> > cells and marked the outline of each cell. Now i need
to
> > count the number of cells present.
>
> There is a very nice demo in the IMAGE PROCESSING
TOOLBOX
> for the same
>
> Small ex:
> I = imread('coins.png');
> imshow(I);
> bw = im2bw(I,graythresh(I));
> figure,imshow(bw);
> bw = imfill(bw,'holes');
> figure,imshow(bw);
> L = bwlabel(bw);
> obj1 = max(max(L))
>
> % OR can use Alternative Code
>
> stats = regionprops(L,'Basic');
> obj2 = numel(stats)
>
> HTH
> Vihang
>
Thank you vihang for your codes. It was very useful to me.
I was able to count the cells with your codes.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
regionprops Vihang Patil 27 Feb, 2008 11:10:25
count Vihang Patil 27 Feb, 2008 11:10:25
segmentation Vihang Patil 27 Feb, 2008 11:10:25
cell counting Shree 27 Feb, 2008 09:20:13
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics