How can I segmentate a portion of microscopic images that inside a square

1 view (last 30 days)
I am trying to semente a portion of images that inside of a column. The sample picture are:
The space inside the square-ish frame is what I try to segmented. The black bar on the top is the blank space generated after I try to align the images.
The "square" is indeed more dark than surrounding environment. But if I BW threshold the image there will still be some cells left; also the frame may not be continuous. This is the sample image of this frame with BW threshold.
The goal is to do this relatively efficiently (this is one of the 50 frames that belongs to one dataset. We have a lot of datasets) and completely automatically.
I am new on image processing. If you have any ideas on how to implement this please tell me. Thank you!
  3 Comments
Tianyu Yang
Tianyu Yang on 11 Jun 2015
Sorry for the confusing. Let me re-elaborate. What I want to segment out of the picture is the space inside the rounded rectangle.
The ultimate purpose of this work is to track the cells in side the image. So I was afraid if there is a cell on the frame the algorithm will think it it multiple cells instead of one. And the cells outside the rectangle is not our interest. So I am going to give up all the pixels outside of the rectangle including the rectangle itself.
The image segmenter tool give me a close approximation to what I want. I don't know how to do it automatically with decent efficiency. How I got that is automated thresholding for the initial mask and run edge-based auto contour for about 3000 cycles. And it has some problems including the small hole inside the frame and some area on the frame. I don't know how to fix them automatically.
I appreciate all the advice you can give me. Thank you very much for your help!
Image Analyst
Image Analyst on 11 Jun 2015
Try this:
threshold at 0 and call imclearborder to get rid of the pure black background.
Threshold at some higher number to get the main background and the center.
Call imclearborder again to get rid of the outside background.
Call bwareaopen to get rid of small blobs, or else use the function in the attached demo to extract the biggest remaining blob.
Attach your code and let me know of any problems.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!