counting the number of objects

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

Jan
Jan 2011년 12월 26일
@Pat: This is your 108th question. It is time to include the required details to make it easy to answer.
Walter Roberson
Walter Roberson 2011년 12월 27일
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
Pat
Pat 2011년 12월 27일
I have uploaded my image
http://imgur.com/n7vGa
Chandra Kurniawan
Chandra Kurniawan 2011년 12월 27일
Hello, Pat.
You said that the three nails were overlapped.
But, I have seen your uploaded image,
and they aren't overlapped each other.
Pat
Pat 2011년 12월 27일
THE nails are overlapped on brain image ,,not on each other,is it possible to count these nails
Image Analyst
Image Analyst 2011년 12월 27일
What other image? You gave the non-overlapped image only, for some reason. Why did you even give that image at all (the solution is trivial)? When you are going to post the overlapped one?
Pat
Pat 2011년 12월 28일
only that image was given to me ,,,thats y i had posted it...
may i know what u mean by
No need - the patient is dead! ;-)
Image Analyst
Image Analyst 2011년 12월 28일
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 2011년 12월 28일
Hahaha :D
I Agree with U

댓글을 달려면 로그인하십시오.

 채택된 답변

Chandra Kurniawan
Chandra Kurniawan 2011년 12월 27일

1 개 추천

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

Pat
Pat 2011년 12월 27일
Thanks chandra
Pat
Pat 2011년 12월 27일
Chandra please look at this
http://imgur.com/HALTv
even when there is a round object it is not detecting
Chandra Kurniawan
Chandra Kurniawan 2011년 12월 27일
So, you need to apply a little different techniques.
Just try to modify my code.
Try to apply another morphologichal operations.
If you still difficult to understand that,
Then show me your original image.
Pat
Pat 2011년 12월 27일
chandra the same code cannot be applied for different images
Pat
Pat 2011년 12월 27일
http://imgur.com/jlnuV
in this at centre there are 4 overlapped parts ehich are brighter in colour ,,,,
Chandra Kurniawan
Chandra Kurniawan 2011년 12월 27일
As long as the background image is same, you don't need to modify
your code.
Please upload the original version of http://imgur.com/HALTv
I'll try to find what's wrong with my code.
Pat
Pat 2011년 12월 27일
Chandra the original version is which i sent u first with 3 nails
i need some more objects as i was told by my guide,so i modified it , i need 5 objects ,so i modified like that
Chandra Kurniawan
Chandra Kurniawan 2011년 12월 27일
Now, What can I do to help you solve your problem?
I think my code will also works on image 'http://imgur.com/HALTv'.
Coz, the missed object in this image (that contains 5 objects) is detected in previous image (that contains 3 object).
Pat
Pat 2011년 12월 27일
It detected only 4 objects
Chandra Kurniawan
Chandra Kurniawan 2011년 12월 27일
Finally, I found the mistake.
The background image that you used are not same.
Check it carefully! The second one is lighter.
Now, just modify line
Ifinal = bwareaopen(Idiff,70);
with
Ifinal = bwareaopen(Idiff,63);
It works on both.
If in the future it doesn't work again,
Just try to setting the value like I did.
I hope this helps you.
Image Analyst
Image Analyst 2011년 12월 27일
No need - the patient is dead! ;-)
Pat
Pat 2011년 12월 28일
Thank u chandra

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2011년 12월 26일

0 개 추천

Probably . . . as long as they're not 100% overlapped and you can come up with some algorithm for separating them.

댓글 수: 1

Pat
Pat 2011년 12월 27일
I have uploaded my image
http://imgur.com/n7vGa

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

질문:

Pat
2011년 12월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by