loading
 
Finding small objects in grass
Patrick Goebel from United States  [3 posts]
9 year
Hi STeven,

I have attached a .robo file that includes a picture of a grassy lawn with two objects sitting on it at a distance (one near the pathway and one near the tree on the left).  To my eyes it is clear where these two objects are but I'm struggling to get a combination of modules that will isolate them completely.

Using the floor_finder modules seems like a good approach as it can eliminate much of the grass.  But I still end up with false positives due to the trees in the background.  Can you help?

Thanks!
patrick

program.robo
Steven Gentner from United States  [1446 posts] 9 year
Patrick,

Could you post test_image_1.jpg? Its just referenced in the robofile but not actually included.

Thanks,
STeven.
Patrick Goebel from United States  [3 posts] 9 year
Hi STeven,

Here is the image.  I thought it was embedded in the .robo file since I checked the appropriate box when saving but perhaps I missed checking the box.

--patrick



 
Steven Gentner from United States  [1446 posts] 9 year
Patrick,

Attached is a variation on how this might be done ... as there are many ways to do this one way is not necessarily more correct than another. But you might use some of the techniques to improve your solution.

First we use the RGB Red channel to focus on the objects. Since most of the foreground is green this helps to isolate and better pronounce the objects.

Second, we use the perspective module to warp the image in such a way as if viewed from above the scene. This has the huge advantage that objects far away and close will appear the same size. This is really helpful when trying to get a single solution that works when the objects are nearer. As we don't have anything to calibrate against you will have to get more images and tweak the value of that module to get it right for your camera. The easiest way to do this is to stand on a straight road and take a picture from the robot at the right angle (I'm assuming your camera angle to the ground is static) and then warp the image until the road appears straight in terms of width from the bottom to the top of the image. See

http://www.roborealm.com/help/Perspective.php

for example on how the hallway route is the same width and even the curved road is too. That's what you are looking for.

We then use the adaptive threshold to identify those objects that are different from their immediate surrounding. This gets us a start to do further processing.

As visual processing is ALL about context we induce some context (i.e. dilate) to each identified blob by growing it a bit. This allows us to then analyse the area surrounding the area for specific properties.

The blob filter then looks at the blob and its source pixels (just after the warp) to determine how spotty the object is. You objects are bright spots whose gradient is stright up (or down depending on how you look at it) whereas the rest of the objects are not really spots. Using this property we can eliminate all but your objects.

While this works for this image, its by no means the right solution. You will need to take video of where the camera currently is all the way to the actual object. When objects change size and the camera pick up more or less of the object it can really affect how modules process the image. Thus, go out and get more images/video that can be used for testing. By using these techniques and perhaps others that we've yet to think off this is very possible to get right.

Hopefully this gives you some ideas ...

STeven.


 

program.robo
Patrick Goebel from United States  [3 posts] 9 year
Hi STeven,

This is fantastic.  Many thanks for taking the time to explain all the steps.  I NEVER would have thought of this approach.  I have an entire video clip from which that image frame was sampled so I will play around with your solution on different parts of the video.  Then I'll take the robot outside again and tweak some more.

--patrick

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index