Need Guidance With Camera Tracking

 
#1

So, I've gotten my wireless camera I bought from EZ Robot temporally mounted on top of the brain of my B9 and powered from the 3rd EZB I've got mounted up there. That makes it about 6 feet above the ground and pointed down to capture movement as people walk past. The idea is to have the radar section swing left or right and follow the movement. I had no problem setting it up and having EZ Builder recognize it after adding the camera control. I got a good clear picture from the camera with little noise. So far so good.

A couple more things: the radar section the camera is mounted on is powered by a small DC gear motor and a H-bridge that is hooked to two of EZB's digital ports (one for each direction of the motor) and also a third for a PWM. So, this being a H-Bridge set up I added the 4 Wire H-Bridge Movement Panel and assigned the proper digital ports for left & right movement. I can press each direction arrow in the panel and get the radar to swing left and right smoothly so I know it's connected and working.

The problem I'm having is that after setting up what I think is the proper settings in the camera control panel I cant get the radar section to follow movement properly. It will notice movement to each side and start to turn in that direction but quickly stop. I can get it to follow me across it's radius if I move very slowly and wiggle around a little but it's a stop and go process. Also it seems to get distracted and focus on other things like stuff laying on the workbench. Almost like he has the attention span of a 1 year old kid that's board with me.

I see there are several settings within the camera control panel that can be adjusted. After tinkering with a few of them I did get better response and tracking but nothing close to what I see in DJ's videos. I have "Motion" checked in the Tracking section and in the Config section I have "Enable Movement Tracking" checked with only the "Allow left/Right Movement" checked.

Does anybody have any suggestions on how to adjust the settings to get my tracking smoother and follow motion of a person walking past better? I'm not sure what to do with the cross hairs of the grid, Motion Delay in the Config area, Tracking speed and the two sliders in the Motion section that adjusts Movement sensitivity and Object Size. Then there is the "Check Every ? Frames" box. I'm getting flustered with all the choices with no real results.

Any advice is welcomed.

Thanks, Dave Schulpius

#2

The grid - EZ-Builder will align the object detected with the centre box. I had mine set very small which caused a lot of movement on the pan/tilt bracket as it was aligning pretty much all the time. The bigger the box the less it'll move.

I also get phantom detection, I put this down to low light. However that is on face and colour detection not movement. In the processed video it'll change to green when it detects movement, when it gets bored of you and looks at what's on the workbench what happens in the processed video?

Check every ? frames I believe waits x amount of frames before looking for movement (to counter it's own movement which would be detected otherwise). The higher the value the less likely it will incorrectly detect movement but also will respond slower.

It took me a while (changing all settings bit by bit) to set mine up so it was responsive enough but not too sensitive. For me it was a case of trial and error (lots of trial, lots of error) to set it up just right.

From what I gather you have the right options ticked and the controls set up correctly, it's just going to be a case of tweaking those settings.

#3

Thanks for the advice Rich.

I have tried to move the two horizontal grid lines totally to top and bottom of the screen and bring the two Vertical grid lines in to capture about a 1/4 of the center of the screen. That leaves me with only two vertical lines visible. I wonder if it's a mistake and I need to bring the two horizontal lines back in?

When it starts to look at things hanging on the wall or on the work bench I see the area turn green and a little box appears. Perhaps it thinks it sees movement where there is none. Maybe a shiny tool or some reflection is sees? Don't know. I do know it focused in on a shinny handle of a whisk broom and seemed fascinated by it.

The Debug window shows activity but it just doesn't seem to follow motion enough.

I think the key will be in the "Check Frames" value and also the "Object Size" and "Sensitivity" sliders. I need to figure out the right Grid placement also.

It's good to hear from others that have fought this battle and how they won (or lost). Thanks for the input. Hope others will chime in.

#4

Well, I've made progress and actually have my robot tracking about 80% the way I'd like to see it work. I used the method Rich and I discussed above. Just started playing with all the controls and sliders. It seems that timing and balance between all of them is the trick. I's have to play around a lot more to the movement close to acceptable I think.

Still, I'm hitting other problems that may just mean that I'll have to scrap this idea. Too bad cuse it's really real cool watching him track me as I move. As I said above I'm using a H-bridge and DC gear motor to move the radar back and forth on my B9. I can get it to move and follow smoothly as long as I don't move past too fast. Then it just stops and sometimes starts looking around. I could live with that I think. However my new problem is that I have the camera mounted inside the plastic bubble with all the blinking and moving lights and I'm getting false movements when it picks up on all the moving and blinking reflections. To add to the problem when the neon flashes from his voice the camera really picks that up and he'll slowly move towards the bright reflection. Sad because I don't think there is a fix for this other than moving the camera out of the bubble and there is no other place I want to mount it so it won't stick out like a sore thumb.

Anyway, here's a recording from the camera mounted in the bubble and you can see what it sees. Again, very cool. Enjoy! :

#5

I can see what's happening. The motion is being detected because of a bunch of lights on your walls and stuff.

You have to remember, anything that moves is considered motion. Even a light is motion. Even a shadow is motion. Even a cat is motion. Even a chicken carrying the easter bunny on his back is motion. Anything that moves is motion Smile Including light.

You will need to cut down on the strobe light in your work area to accurately track motion. Less partying and more robots Smile

#6

Thanks for posting that Dave. I was planning on doing the same thing with my camera. Like you, I may have to rethink that. I am less concerned about creating a perfect likeness than you are, but here is another idea that I was thinking about, you might consider. A small hole right in the front of the radar, fitted with a tinted lens close to the same color (like sunglasses) might not look too unsightly.
I am not sure if your radar is hollow or not. Since I am making mine, I can design it that way.
Again, it is just a thought. I am willing to make some compromises in mine for the sake of functionality, and quite frankly, a lack of resources and skill. But, I can certainly understand if you don't want to spoil the looks of yours. It really is a work of art.
User-inserted image

#7

Also, keep in mind that you may have a reason to use the "Servo Track Relative Position" - which means mounting the camera stationary on your robot.

In many cases, the camera will benefit from sitting still. And the Servo Track Relative Position option (found under Camera -> Configuration) will help you.

It's best to play with different setups and learn how the settings work before making a decision.

#8

Thanks for the input. Unfortunately turning off the lights are not an option. They are part of the robot and come from inside the bubble where the camera is sitting. Luckily I just have the camera mounted temp. Funny, I did notice it was seeing shadows on the wall also and stopping on them. LOL.

I think my only option is to move the camera outside the bubble. Danger, your idea is a good one and may work nicely. I wish I would have thought about this before I completed the finished the paint job. I think I may have room in the radar in the place you showed but right now I'm not willing to tear it all apart and drill holes. Maybe later on.

I'm interested in the relative servo position You mentioned DJ. Will this work with a H-Bridge set up?

Thanks again for the comments and suggestions.

Dave Schulpius

#9

Forgive me for what follows, but when I watch that video I can't help but think that it would make a good opening to a Sci Fi horror flick.
We see through the eyes of the robot as he first becomes self aware. Confused, he looks around the room, slowly at first, and then more frantically. The inventor is back to, busily working on the computer. The red flashes of light and streaks across the screen would be a plot tool to denote danger. The ominous music would continue to build, and then suddenly.

Wait a minute; Brett is the horror author here. I'll let him finish the story. Sadly though Dave, it doesn't look like it's shaping up to be a happy ending for you. Frown

#10

Oh, I should have paid more attention. You're using the "Movement" option instead of "Servo" because you have created your own giant servo. The Servo Track Relative won't help you because the Movement HBridge does not have an idea of what location the robot is looking.

I was just thinking about something. You know how your body swivels with an HBridge and a POT? That's a giant servo, essentially. What if we helped you turn it into a servo? That way, you won't need any code in EZ-Builder... You would be able to simply use it as a servo.

I'm thinking of one of two options..

1) Connect the HBridge to the guts of a servo. i.e. replace the motor of a servo with an HBridge.

2) Use an embedded microcontroller (i.e. arduino) to simulate a servo using your existing POT and HBridge.

Let me take a look in the lab and see if I can come up with something for those two. This will simplify your project a great deal and benefit others who are doing the same. Smile