Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
cell counting

Subject: cell counting

From: Shree

Date: 27 Feb, 2008 14:19:01

Message: 1 of 8

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 8


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 8

"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 8

"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.

Subject: cell counting

From: john

Date: 25 May, 2009 16:08:01

Message: 5 of 8

"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.....

Hi! i have the inverse problem, i can count the cells but i havent find a good way to segment and filter the image... can you help me? if you have the code can you write it down... tnx a lot!... wating for your reply..

Subject: cell counting

From: ImageAnalyst

Date: 25 May, 2009 17:08:01

Message: 6 of 8

On May 25, 12:08 pm, "john " <makavelli_s...@hotmail.com> wrote:
> "Shree " <sherly2443.nos...@mathworks.com> wrote in message <fq3rgl$7r...@fred.mathworks.com>...
> > Could someone help with counting the number of cells that
> > have been segmented in an image.....
>
> Hi! i have the inverse problem, i can count the cells but i havent find a good way to segment and filter the image... can you help me? if you have the code can you write it down... tnx a lot!... wating for your reply..

-------------------------------------------------------------------
And your image is where? One can't really answer this until one sees
your image.

Subject: cell counting

From: john

Date: 25 May, 2009 18:27:01

Message: 7 of 8

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <f5579646-d753-41a6-b20e-d4920bd2dddd@s28g2000vbp.googlegroups.com>...
> On May 25, 12:08?pm, "john " <makavelli_s...@hotmail.com> wrote:
> > "Shree " <sherly2443.nos...@mathworks.com> wrote in message <fq3rgl$7r...@fred.mathworks.com>...
> > > Could someone help with counting the number of cells that
> > > have been segmented in an image.....
> >
> > Hi! i have the inverse problem, i can count the cells but i havent find a good way to segment and filter the image... can you help me? if you have the code can you write it down... tnx a lot!... wating for your reply..
>
> -------------------------------------------------------------------
> And your image is where? One can't really answer this until one sees
> your image.

oh yes sorry... i have packed the images with the text problem in a zip files.. i send you by e-mai.. tnx....l

Subject: cell counting

From: ImageAnalyst

Date: 25 May, 2009 19:16:59

Message: 8 of 8

On May 25, 2:27 pm, "john " <makavelli_s...@hotmail.com> wrote:
>>> tnx a lot!... wating for your reply..
>
> > -------------------------------------------------------------------
> > And your image is where?  One can't really answer this until one sees
> > your image.
>
> oh yes sorry... i have packed the images with the text problem in a zip files.. i send you by e-mai.. tnx....l

---------------------------------------------------------------------------
I don't do private consulting. I can't even reply from this spam-
avoidance email account and I don't monitor it. Post your stuff
publicly. Anyway, you probably want more opinions than just mine.
FYI, there are probably more experts in image processing over in
sci.image.processing than here (but they don't all use MATLAB). Why
don't you start your own new thread anyway rather than piggy back on
Shree's?

Tags for this Thread

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.

Contact us