Camera angle vs 3d motion
Hi there,
For my final year in highschool I have to do a project.
I chose to build a spotlight that can track people.
Doing that by detecting movement from a static camera and passing it to two motors that move it up/down and left-right.
As you might see, the movement left/right will create a circular motion in the camera's perspective.
My goal is to transform the circular motion into real left/right in camera perspective.
The ideas I have now are to calibrate on forehand (i.e. seeing what movement is required from topleft to midleft)
And then calculate the other pixellines.
But this seems to be harder than it looks.
So, does anyone have other ideas or can somebody help me?
Thanks.
Re: Camera angle vs 3d motion
Is it a digital camera where you're somehow processing the image? If so you can probably ignore many details in favor of approximations. For example, if the object you're tracking is far away you can ignore the effects of "circular" motion when tracking a pixel, and just figure out how far left or right your motors should turn in that case.
You could also use an algorithm that dynamically adjusts how quickly the motors should move based on how good a job it's doing at keeping track of the object. This would get around the issue of complicated circular motion models completely and, to an approximation determined by your measurement's accuracy, accomplish very low lag tracking in all cases. You would basically say "my motors are moving the camera at this speed to the right, but the object is getting away from us--oops, move a bit faster--there, now we're keeping up." Come to think of it I'm not really sure what you'd do without some implementation like this without being able to assume the person would walk, say, in a straight line.
Re: Camera angle vs 3d motion
Thing is, the camera is at in a static position. The light moves.
Also the motors are on fixed speed. That way I am able to calculate accurately how long the motors need to work to get to a certain position.
It doesn't really matter if it doesn't keep up; it'll simply recalculate the route.
The thing I need to know is how to compensate with the up/down movement to draw a straight line in the camera's perspective.
Re: Camera angle vs 3d motion
Lemme get the details of the problem straight. You've got a camera looking down on a stage (or is it head-on?). You've got a spotlight, let's say right next to the camera (or is it over a ways?). The spotlight can move left/right/up/down at constant angular velocities ("fixed speed") if you activate the motors.
You have an object you're tracking with some sort of picture recognition software, and you want to send commands to the motors to track this object as well.
It still seems to stand to reason that if you can track the motion of one object you can track the motion of your spotlight, and just dynamically adjust the motion until the spotlight and the object you're tracking coincide.
If you're dead-set on finding a function mapping the x-y coordinates of the object the camera is tracking to positions of the camera's rotation that should be possible. I'd have to think about the specifics more though. Is this bit your question?