counting the number of objects

2 views (last 30 days)
Pat
Pat on 26 Dec 2011
I have an brain image and there are three overlapped objects.The overlapped object is nails ..can i count these overlapped objects.in medical images
  9 Comments
Image Analyst
Image Analyst on 28 Dec 2011
If I had three nails embedded in my brain, most likely I would be dead, and a physician could instantly see how many nails had killed me, and wouldn't need an image processing program to count them. So why did you ask about overlapping nails when that's not what you have?
Chandra Kurniawan
Chandra Kurniawan on 28 Dec 2011
Hahaha :D
I Agree with U

Sign in to comment.

Accepted Answer

Chandra Kurniawan
Chandra Kurniawan on 27 Dec 2011
Hello, Pat.
It is possible to count the nails.
You just need to perform some morphologichal operations, such as
erosion, area open, etc.
Then, in the next step you need to count the objects. You can use regionsprops command.
Here my demo :
Irgb = imread('n7vGa.jpg');
Igray = rgb2gray(Irgb);
Ibw = im2bw(Igray, 0.9);
se = strel('square',2);
Imorph = imerode(Ibw,se);
Iarea = bwareaopen(Imorph,130);
Idiff = Imorph - Iarea;
Ifinal = bwareaopen(Idiff,70);
stat = regionprops(Ifinal,'BoundingBox');
str = sprintf('number of detected nails : %d', length(stat));
imshow(Irgb); title(str); hold on;
for cnt = 1 : length(stat)
bb = stat(cnt).BoundingBox;
rectangle('position',bb,'edgecolor',rand(1,3));
end
And the result :
Is that you meant??
  12 Comments
Image Analyst
Image Analyst on 27 Dec 2011
No need - the patient is dead! ;-)
Pat
Pat on 28 Dec 2011
Thank u chandra

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 26 Dec 2011
Probably . . . as long as they're not 100% overlapped and you can come up with some algorithm for separating them.
  1 Comment
Pat
Pat on 27 Dec 2011
I have uploaded my image
http://imgur.com/n7vGa

Sign in to comment.

Categories

Find more on Image Processing and Computer Vision in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!