Detect multiple Objects

What is the best way to detect and count multiple same objects like cucumbers on a conveyor belt?

First find blobs via img.find_blobs and then a classification for each via tf.classify?
That could be a performance problem!

Does somebody has any idea? What is a possible solution?

So, what’s the scene look like? Is it a bunch of cucumbers right next to each other? Or, are they far apart?

Find_blobs() works great when the background has contrast. E.g. you have a cucumber and then it’s on a black surface and there’s nothing near it.

Thanks Kwabena for your quick response.

At following you’ll find 2 pictures, there you’ll see that the conveyor belt is mostly black.

cucumber_beld2

I’m going to mount the camera right above the conveyor belt so that the cutout is only pointing at the conveyor belt.

You might try find_line_segments. Each cuke should show a segment for each side. You can filter to length, etc. In sunshine, you’ll get the shadow too, but maybe you can shade the place where the camera is looking.

You’ll have to figure out the timing, so you get a unique set of cukes for each snapshot and don’t miss any. Good luck.