Classification of Cells

Could you please help me to solve this Matlab problem? I have an exam and I can't do this.

4 Comments

Someone please help.
dostum sorunun cevabını bulabildin mi
Approximate translation:
Did you find the answer to the problem, my friend?
The answer is given in my tutorial: http://www.mathworks.com/matlabcentral/fileexchange/25157-image-segmentation-tutorial All he had to do was to make slight modifications, like the image filename, etc.

Sign in to comment.

Answers (2)

Walter Roberson
Walter Roberson on 3 Nov 2011

0 votes

The assignment does give step by step instructions. Perhaps you should post what you have so far based on those instructions, and explain the point you are stuck on.

10 Comments

I couldnt eliminate the boundaries in step 2. We cant use imclearborder. I couldnt also do the rest steps too...
This is my code that I wrote yet.
Im=imread('blood_cells.jpg');
Im2=rgb2gray(Im);
figure
imshow(Im2);
level=graythresh(Im2);
Im3=im2bw(Im2,level);
figure
imshow(Im3);
L= bwlabel(Im3,8);
[L, num]= bwlabel(Im3,8);
figure
The page of instructions is cut off on the right hand side. There _is_ a download button, but it requires creating an account on scribd.com which I do not wish to do.
One of the regionprops is the bounding box. If the bounding box touches a border then some pixel in the component must touch the border -- otherwise a smaller bounding box would have been used.
To get rid of blobs touching the border, which is basically the entire background of your image, if you can't use imclearborder, just label it and set the 1 values to 0.
labeledImage = bwlabel(binaryImage);
labeledImage(labeledImage == 1) = 0; % Poof - they're gone!
How can I label these images that touching the border?
@Walter it wont take more than 10 secs to create an account because you just enter your mail address and its completely safe and no spam.
Image Analyst's answer only works if you consider the white areas to be the objects and the black areas to be the cells. I believe that the image uses the other way around, though: it appears to me that the black areas are the cells and the white area is your background. Note that the image processing routines assume that black (0) is background, so you will need to do a binary negation of your image along the way.
With regards to creating an account on scribd: I cannot do that, as I do not agree to the legal Terms and Conditions of the site.
Please see http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
As far as I know, all of the sites listed there allow downloading without creating an account. Some of them are a nuisance for volunteers, though: in particular, easy-share, rapidshare, and jumbofiles are not friendly to time-starved volunteers.
Image Analyst
Image Analyst on 3 Nov 2011
Edited: Image Analyst on 2 Jan 2017
Walter, my answer (bwareaopen, BlobsDemo) works if you consider the foreground objects to be white, like you said. But, like you said, his objects are black. That's why I said to invert the image. After you do that, his white background that touches the border is gone, his black blobs are now white, and you can do any standard image processing operations where the foreground is assumed to be the white blobs.
Ahmet: What kind of help do you want? it pretty much spells out what to do step by step. Do you want us to totally complete your assignment and hand over the code to you for you to turn in as your own? Or you're looking for something else?
I'm told it is my turn to make the meal, alas.

Sign in to comment.

Image Analyst
Image Analyst on 3 Nov 2011

0 votes

Why can't you use imclearborder? Anyway, you might not have to if you invert the image. Also check out bwareaopen to do size filtering. You might check out my image analysis tutorial, BlobsDemo. It's kind of similar. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

Categories

Find more on Convert Image Type in Help Center and File Exchange

Asked:

on 3 Nov 2011

Commented:

on 2 Jan 2017

Community Treasure Hunt

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

Start Hunting!