object tracking on camera movement - computer-vision

Suppose I have some static object with its known 2D bounding box position for the first frame of video streaming.
My mission is to track this object throughout the video, while the object is static but the camera is moving (right, left, rotating, up, down).
Is there some algorithm that I can use for this mission? or Is it possible to adapt some classic object tracking algorithm to that mission?
Thanks.

Related

Select a region and detect its motion in greyscale camera stream

I am using ESP32-CAM module to grab frames and currently trying to build code to detect movements of a single object that i select by placing a circle around it.
Here, a yellow circle represents point of interest
After few minutes i move the object a bit, the marker should follow.
I would like to be able to determine movement of pixels(object) inside this circle and update the marker (circle) with new position on next frame.
Since i have no additional libraries to use, what would be the solution for this problem ?

Calculating the rotation and translation (external parameters) of multiple cameras relative to a single camera?

Given a set of 5 cameras positioned as shown in the image below which capture the top, front, rear, left and right views of an object placed in the center.
Also given that the origin of the world coordinate is assumed to be the top view (therefore used as the reference view), how do I go about calculating the rotation and translation (external parameters of the cameras) of all other 4 cameras relative to this top camera. The front, rear, left and right cameras have also been slanted 45 degrees (about the x axis) to capture the object in the middle.
The calculation of the external parameters will later be used to calculate the projection matrix for each camera (the internal parameters are known)
Calibrate the extrinsic parameters with respect to an object of known shape and size which is visible to all cameras, or at least to all pairs of (reference camera, current camera).
For best results use a 3D object, not a plane. For example, a box with three unequal sides, or a dodecahedron. The latter would allow you to calibrate all cameras simultaneously, since each of them should see three faces at least. Depending on your accuracy requirements, you may need to spend some real money on getting this object machined accurately.
As for software, you can of course whip up a script to do it using OpenCV, or just use a CG tool like Blender, where visualization of the results may be much easier.

Max range for object detection

I determining the distance of an object from a camera where the object moves towards the camera. Using a webcam I am successfully able to detect the object upto 1 meter but cannot detect beyond it.
I have to agree with the answer in this post OpenCV Max Detection Range, where the object contour increases as the object moves towards the camera. The object in question has a size of a tennis ball. Any suggestions to detect the said object at a distance greater 20m ?

Centring Sprite or moving camera? C++/Opengl

I'm self learning C++ and playing around 2D tile mapping.
I have been reading through this scrolling post here, which is based on this tiling tutorial.
Using the above tutorial and some help from the Pearson, Computer Graphics with OpenGL book I have written a small program that draws a 40x40 tiled world and a Sprite (also a tile).
In terms of drawing/render order, the map(or world) itself is that back layer and the Sprite is the forward most (or top) layer. I'm assuming that's a good way of doing it as its easier for 2 tiles to interact than a tile and a custom sprite or rectangle. Is that correct?
I have implemented a Keyhandling() function that lets you move the map inside the viewport using the keyboards arrow keys. I have a variable called offsetx, offsety that when a key is pressed increases or decreases. Depending on whether I assign the variable to the map or sprite, I can more one or the other in any direction on the screen.
Neither seems to work very well, so I assigned the variables to both (map and sprite) but with positive values for the sprite, and negative for the map. So upon a key press, this allows my Sprite to move in one direction whilst the map moves in the opposite direction.
My problem is, the sprite soon moves enough to leave the window and not enough to bring the more of the map into the scene. (The window only shows about 1/8th of the tiles at any one time).
I've been thinking all day, and I think an efficient/effective way to solve this issue would be to fix the sprite to the centre of the screen and when a key is pressed the map moves around... I'm unsure how to implement this though.
Would that be a good way? Or is it expected to move the viewport or camera too?
You don't want to move everything relative to the Sprite whenever your character moves. Consider a more complicated world where you also have other things on the map, eg other sprites. It's simplest to keep the map fixed, and move each sprite relative to the map, (if it's a movable sprite). It just doesn't make much sense to move everything in the world whenever your character moves around in the world.
If you want to render your world with your character always at the center, that's perfectly fine. The best thing to do is move the camera. This also allows you to zoom your camera in/out, rotate the camera, etc. with very little hassle in keeping track of all the objects in the world.
Be careful with your usage of the word "viewport". It means a very specific thing in OpenGL. (ie, look at the function glViewport). If your book uses it differently, that's fine. I'm just pointing this out because it's not 100% clear to me what you mean by it.

Dealing with drift-over-time in rigid object tracking?

I'm tracking a rigid object that can move slowly or stand still for long periods of time (72 hours). A drawback of most approaches is the error accumulation over time resulting in a drift away from the object.
Is there a standard method to avoid this? The object can and will move/rotate in 3 dimensions.
I'm using SIFT+RANSAC type matching at the moment to find corner points then matching them on the assumption that some kind of constellation matching would eliminate drift.
I see what you mean now. If the camera is still, your target object's projection on the camera should always be at the same aproximate 2d coordinates if the object is still. In your first frame, remember the 2d coordinates of the projection. For the rest of the frames create a low pass filter over the (current 2d coordinates - initial first frame coordinates) over time to filter out small errors in position. After a certain threshold, consider the object moved.