Matlab - distinguish between overlapping low contrast objects in RGB or Grayscale image

I have a big problem detecting objects inside an image. I know this topic has already been discussed in many forums, but I've been spending the last 4 days looking for an answer and haven't been able to.

In fact: I have an image from a branch ( http://cl.ly/image/343Y193b2m1c ). My goal is to count each needle in this picture. Therefore, I have to face several problems:

Separate the branch with your tails from the background (which is not a problem in this case).

Select the borders of the needles. This is a huge problem; I tried different ways including all edge () functions, but the problem is always the same: the borders around the needles are not closed and - which leads to the last problem:

The needles are overlapping! This results in "squares between needles" which, if I use imfill () or an equal formula, fill in instead of needles. And: the places where the needles are concentrated (many needles in one place) are almost impossible to distinguish.

I tried watershed, I tried to enhance contrast, Kmeans clustering, I tried imerose, imdilate and related functions followed by edge detection. I also tried to filter and flatten the image a bit to soften the needles a bit so that not every slight color change would be recognized as a border (which is another problem).

I'm relatively new to Matlab, so I don't know what I need to look for. I tried to follow the MatLab guide used for Nuclei detection, but with this I can just get all the green objects (all the needles at once).

I hope these questions haven’t come up before - if so, I apologize for the double mail. If anyone has any idea what to do or what methods to use, that would be awesome and safe, this is a really bad start to the week.

Thank you very much,

Phillip

+3


source to share


2 answers


Distinguishing overlapping objects is very, very difficult, especially if you don't know how many objects you have to distinguish. Your brain is much better at picking out overlapping objects than any segmentation algorithm I know of, as it is capable of integrating a lot of information that is difficult to code. Therefore: if you cannot distinguish some functions on your own, forget about how to do it with code.



Having said that, you might be able to get a rough count of the needles: if you can segment the pixels of an image into two classes, "needle" versus "non-needle", and you know how much of your painting is covered by the needle (this can help include ruler when you take a picture), then you can divide the number of “needles” -pixels by the number of pixels covered by one needle to estimate the total number of needles in the image. This will underestimate the number of needles somewhat due to overlaps, and it will underestimate the denser needles (due to more overlap), but this should allow you to automatically compare between branches with more needles and branches with multiple needles, and also to detect changes in time, this should be one of your goals.

+1


source


I agree with @Jonas = you have one HUGE problem.

Let me make a few suggestions.



First, in the direction of @Jonas, instead of getting an accurate count, another way to get a rough estimate is by counting the tips of the needles . Obviously, not all clues are clearly visible. But, if you can get a transparent mask of a branch, it would be relatively easy to define the tips of the needles using some of the morphological operations you mentioned yourself.

Second, is there a way to get more information? For example, if you have depth information, it can help you differentiate the needles a bit from each other (this will not completely solve the problem, but it can help). You can get depth information from stereo, i.e. Take two photos of a branch with a little camera movement. If you have a Kinect device at your disposal (or some other range camera), you can get the depth map directly ...

0


source







All Articles