How do I count particles in a multi-colored image?

4 visualizzazioni (ultimi 30 giorni)
Hey everybody,
I'm searching for an approach to count particles (and get their area) in an image. Only the inner area is the area of interest. The outer rings are out of interest. Most of the approaches and functions I found in examples are high-contrast or black-white images and therefore kind of straight forward processing. In my example it's an image of an EHL-Tribometer that shows different film thicknesses.
I tried to get any further with watershed (https://blogs.mathworks.com/steve/2013/11/19/watershed-transform-question-from-tech-support/), and got this. But after that I didn't know how to identify the areas around particles.
example = imread(...);
wexample = watershed(example);
imshow(wexample)
I also tried to identify the outer rings ("imfindcircles") that are not in my view of interest. I wanted to delete everything around the inner ring. But it wasn't possbily to identify them.
example = imread(...);
d = drawline;
pos = d.Position;
diffPos = diff(pos);
diameter = hypot(diffPos(1),diffPos(2));
radius = [round(diameter/2)-20,round(diameter/2)+40];
[centers,radii] = imfindcircles(example,radius,'ObjectPolarity','dark');
viscircles(centers,radii);
I don't want to list all the functions I tried. These were the ones I thought that get me further but didn't.
Hopefully I described my problem well enough. Could you get me some hints or functions I could try to get me to a solution?

Risposta accettata

Jonas Thomalla
Jonas Thomalla il 10 Nov 2020
I now create a cropped image with the ROI (like drawellipse). Then I call the color thresholder:
colorThresholder(image.croppedImage(1).data);
uiwait(msgbox('Create a mask with color Thresholder (L*a*b* color space seems the best) and export the generated code (export > export function). After that click OK in the next window.'));
uiwait(msgbox('I finished thresholding and exported the function/code.'));
colorThresholder close;
Then I use this to fill small areas and finally edit all cropped images with the createMask()-function (from color thresholder).

Più risposte (0)

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by