1

I have image of ribs in a factory and some of them can be bent. For each rib I have binary mask of it - here you can see masked image of all ribs at once. Masked ribs illustration:

img

If it helps you, here are all ribs masks connected to one. Rib masks:

img

As you can see, ribs aren't just vertical, but can be rotated too. But i need detect bent ones (for example third rib from left in image). Do you please have any idea how to do it?

I have tried distance transform to find center of rib and then working with it like with 1D function, but whole rib is about 50 pixels wide, so noise is too big - function has too much peaks to use derivatives or some approximation. Next, I wanted to try something like Hough-Lines on upper and lower part separately, but details I am looking for (as you can see, bent is not big) are too small for this method.

All I need is to say "is bent" or "is not bent". At the moment, I have no other ideas how to detect bent ribs. I would be pleased for some idea.

Spektre
  • 49,595
  • 11
  • 110
  • 380
google2
  • 315
  • 3
  • 8
  • 1
    can they touch? What would you need to detect a bend? Angle difference from vertical isn't enough, right? Without domain knowledge I can't decide which of those ribs are bent. – Micka Aug 15 '17 at 08:46
  • They shouldn't touch and you have mask for each rib separately, so you don't have to care about other ribs. But to answer your question, ribs shouldn't touch each other. I need to detent bend ones, yes. Angle difference isn't enough - it's another detail to tell about rib, but i need detect "banana" ones (bent ones). – google2 Aug 15 '17 at 08:51
  • 1D functions seems a good idea. Maybe you could create two 1D functions for each rib: one per "side" (should be easy to detect). – Gabriel Devillers Aug 15 '17 at 08:53
  • the ones that foreshorten without bending may not be classified as bent? Like 10th from left – Micka Aug 15 '17 at 08:59
  • @Micka : this is just testing image and 10th rib is problem with detection - there is a shadow, because of bad lighting. In final assembly in factory, lighting should be solved better, so this shouldn't be problem. Or this won't be solved and will be detected as bent, this is not important, at least not now. – google2 Aug 15 '17 at 09:12
  • @GabrielDevillers it looked as good idea, but rib edges aren't smooth. Here, function values are indexes of first unmasked pixel. Red are edges and green is average of red ones. Didn't want to answer my own question, so here is link to images. https://www.dropbox.com/sh/pjvdqykssfyiu50/AACH0GpZS0_MK8P5Gceof0iDa?dl=0 as you can see, noise is quite big compared to difference is bent and not bent rib. If you have idea how to proceed it, would help me a lot. – google2 Aug 15 '17 at 09:25
  • If I had some time I would experiment with cv::minAreaRect and approxPolyDp and those contours – Micka Aug 15 '17 at 10:51
  • @Micka thanks you a lot for you tip. Will try it. – google2 Aug 15 '17 at 14:34
  • @google2 maybe the answer to my question could help you, too. But not sure, because there are some concave "holes" in your contours and there might be concave regions because of the bending. https://stackoverflow.com/questions/35226993/how-to-crop-away-convexity-defects – Micka Aug 15 '17 at 14:36
  • 1
    @Micka Thank you. I had not even got idea to use contours, so thank you for inspiration. Will write if it ends up well. – google2 Aug 15 '17 at 17:47

0 Answers0