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:
Particle Segmentation

Subject: Particle Segmentation

From: F B

Date: 9 Nov, 2010 15:21:03

Message: 1 of 5

Dear All,
Dear all,

I am working with the current picture
www.yfrog.com/c8hgfredrab5green1j

My problem lies in detecting the red pixels (which are vesicles) accurately. I am able to threshold them correctly however, once I use regionprops and run the rest of my code, performing calculations using the data acquired from regionprops, this returns me wrong values. It can be seen that scattering the centroids of the red pixels returned to me via regionprops seems seems wrong, as can be seen in the next picture (which represents a zoomed in section of the scatter vesicles superimposed on the thresholded image)

www.yfrog.com/75missingallvesiclesj

I was just wondering whether anyone could point me in the drection towards a method which would help segment them appropriattely. I have tried normalising the image and thresholding it in various ways however however (as can be seen above) when I plot the coordinates of the vesicles to test if they have been identified correctly, it returns "wrong" coordinates.

Thank you all for any help,

Regards,

FB

Subject: Particle Segmentation

From: Sean

Date: 9 Nov, 2010 15:53:03

Message: 2 of 5

"F B" <worldindustri33@hotmail.com> wrote in message <ibbosv$67e$1@fred.mathworks.com>...
> Dear All,
> Dear all,
>
> I am working with the current picture
> www.yfrog.com/c8hgfredrab5green1j
>
> My problem lies in detecting the red pixels (which are vesicles) accurately. I am able to threshold them correctly however, once I use regionprops and run the rest of my code, performing calculations using the data acquired from regionprops, this returns me wrong values. It can be seen that scattering the centroids of the red pixels returned to me via regionprops seems seems wrong, as can be seen in the next picture (which represents a zoomed in section of the scatter vesicles superimposed on the thresholded image)
>
> www.yfrog.com/75missingallvesiclesj
>
> I was just wondering whether anyone could point me in the drection towards a method which would help segment them appropriattely. I have tried normalising the image and thresholding it in various ways however however (as can be seen above) when I plot the coordinates of the vesicles to test if they have been identified correctly, it returns "wrong" coordinates.
>
> Thank you all for any help,
>
> Regards,
>
> FB

So is each red pixel a vesicle or each red blob? Could you maybe draw a box (in photoshop or something) around a few examples of what you expect an individual vesicle to be. There are many red pixels outside of the main area of the photo, are these also vesicles? (I guess that's what spawned my question).

Depending on the answer a few ideas:
-A simple threshold to identify red areas
-An erosion to separate blobs
-Labelling
-Dilate the labelled image
-Use a logical AND on the labelled image and the threshold image to define the vesicles
-Regionprops

Subject: Particle Segmentation

From: F B

Date: 9 Nov, 2010 16:04:03

Message: 3 of 5

"Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <ibbqov$c0m$1@fred.mathworks.com>...
> "F B" <worldindustri33@hotmail.com> wrote in message <ibbosv$67e$1@fred.mathworks.com>...
> > Dear All,
> > Dear all,
> >
> > I am working with the current picture
> > www.yfrog.com/c8hgfredrab5green1j
> >
> > My problem lies in detecting the red pixels (which are vesicles) accurately. I am able to threshold them correctly however, once I use regionprops and run the rest of my code, performing calculations using the data acquired from regionprops, this returns me wrong values. It can be seen that scattering the centroids of the red pixels returned to me via regionprops seems seems wrong, as can be seen in the next picture (which represents a zoomed in section of the scatter vesicles superimposed on the thresholded image)
> >
> > www.yfrog.com/75missingallvesiclesj
> >
> > I was just wondering whether anyone could point me in the drection towards a method which would help segment them appropriattely. I have tried normalising the image and thresholding it in various ways however however (as can be seen above) when I plot the coordinates of the vesicles to test if they have been identified correctly, it returns "wrong" coordinates.
> >
> > Thank you all for any help,
> >
> > Regards,
> >
> > FB
>
> So is each red pixel a vesicle or each red blob? Could you maybe draw a box (in photoshop or something) around a few examples of what you expect an individual vesicle to be. There are many red pixels outside of the main area of the photo, are these also vesicles? (I guess that's what spawned my question).
>
> Depending on the answer a few ideas:
> -A simple threshold to identify red areas
> -An erosion to separate blobs
> -Labelling
> -Dilate the labelled image
> -Use a logical AND on the labelled image and the threshold image to define the vesicles
> -Regionprops

Dear Sean,

Each red pixel represents a vesicle. The red pixels outside the main area of the picture also represent vesicles however those can be easily neglected.

I shall try your method.

Would it not be better to apply the calculations in my program for every pixel in the image first instead of labelling and using regionprops at the beginning.

I could then return a matrix with the answers that I need, multiply this matrix by the red plane thus deleting all entries which represent green and blue object. Lastly, I could then continue my analysis by determining which pixels are in the boundary and weighting the answers by the intensity of each pixel. Therefore, I would be able to avoid using regionprops ? Or would this method be innapropriate ?

Thanks a lot,

FB

Subject: Particle Segmentation

From: Sean

Date: 9 Nov, 2010 16:14:04

Message: 4 of 5

"F B" <worldindustri33@hotmail.com> wrote in message
> Would it not be better to apply the calculations in my program for every pixel in the image first instead of labelling and using regionprops at the beginning.
>
> I could then return a matrix with the answers that I need, multiply this matrix by the red plane thus deleting all entries which represent green and blue object. Lastly, I could then continue my analysis by determining which pixels are in the boundary and weighting the answers by the intensity of each pixel. Therefore, I would be able to avoid using regionprops ? Or would this method be innapropriate ?
>
> Thanks a lot,
>
> FB

Yes, if each pixel is a vesicle, I was unsure of this before. If every red pixel is a vesicle, then isn't the centroid of each vesicle just the coordinates of that pixel? You have no reason for regionprops at this point because you don't have lumps of pixels to analyze at once, and thus general statistics from the original image should work fine.

It sounds like you want to find vesicles' distance to the boundary. To do this make the boundary edge true (edge of the green plane) and then do bwdist on the whole image.
The distances at the corresponding pixels in the distance image will be the distance from the boundary.

Subject: Particle Segmentation

From: F B

Date: 10 Nov, 2010 16:16:03

Message: 5 of 5

>
> It sounds like you want to find vesicles' distance to the boundary. To do this make the boundary edge true (edge of the green plane) and then do bwdist on the whole image.
> The distances at the corresponding pixels in the distance image will be the distance from the boundary.

Thanks a lot Sean. I will try it out.

Regards,

FB

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