-
The Depth Quandary
01/22/2021 at 20:19 • 1 commentThe resolution of the depth information you can get just from object size is going to drop off really quickly as you move away from the camera.
When you are relatively close to the camera, the ball will occupy a lot of pixels and the depth of the object within the frame is high resolution.
As you move away from the camera however, the number of pixels the ball is occupying in your captured image rapidly decreases.
As that happens, the possible position of the ball along a line in space drawn from the camera to the center of the ball, gets larger and larger. Eventually a single pixel error in calculating the ball size will translate to a massive positioning error along that line!
Some Solutions
- We use a larger ball.
- This moves the useable range of the sensing out further at the expense of near
- A larger wand is more cumbersome.
- We use a camera with a narrower FOV.
- This decreases the usable width and height of the performance area, but then extends the length.
- The camera will need to be further away from the performance area to start with.
- We use a camera with a really high resolution.
- The speed of OpenCV is inversely proportional to the number of pixels you are feeding it. Bigger images are a lot slower to process.
- Using the very low latency integrated CSI-2 camera interface of the PI or Jetson Nano, we end up maxing out at 8MP or about 1080P@30fps of RAW image data. To do much better than this we would need to use a USB-C camera and the cost skyrockets.
- We use stereo imaging and determine the depth via triangulation.
- We immediately lose half of the capture rate.
- We lose the ability to track multiple objects without more work as we can't triangulate each object without being able to differentiate them.
- Flashing each ball works, but then your capture rate goes down really fast as only one ball per color can be lit per captured frame and then the flashing must to be coordinated.
- Using different colored balls works, but then you lose the ability to paint in the color you are seeing as the ball.
For now I think the solution I am going with is to use a narrower FOV CSI-2 camera that can do 1080P@30fps and feed it to a Jetson Nano.
- We use a larger ball.
-
Hackchat of the start of this..
01/20/2021 at 19:30 • 1 commentDropping an idea here. Light up and track a ping pong ball on a stick with a stationary camera using OpenCV using size as your depth cue. Re-create as a 3D model, displaying it with rotation around the center of it. Allow changing the color of the ball, duplicate in the model.
3D light painting in realtime.
Daren Schwenke11:16 AM
Suppose you could use IMU and a cell phone and guess the approximate location of the camera as well to eliminate the stationary bit.
you can also use looming to determine distance
that's how insects avoid obstacles
you mean using just a single camera then?
sure, and low-res too
i'm curious how well using a single std. camera would work compared to stereo
one thing with looming is that it requires motion
ahh
works best when you move towards the object at a known speed
you basically see how fast it grows -- objects that are close grow faster than object that are far
@Daren Schwenke meant, or are there reasons that doesn't work well compared to 2 cameras
could you simply use the diameter of the ping pong ball in pixels, from a single camera, and convert that to depth, which i thought is whatit's easier than stereo, because instead of finding the same object on two different photos taken at slightly different angles, you just need to find the same object at two different sizes
@anfractuosity that requires pretty large resolution, though, or very consistent lighting
and knowing the size of the ping pong ball in reality too maybe?
ping pong balls have standardized size
oh true heh
i think ToF cameras sound pretty nifty, not sure how pricey they are though
Kinect
the first one used a pattern i thought, is the 2nd one tof then
if you can control the hardware in the wand, there are easier ways to do this
like the wii rmote
oh that uses ir i think?
and a sensor bar thing right
doesn't matter if the light is visible or not
oh actually the 'bar' is the light emitter i think actually
the important thing is it's modulated, so you can tell it from the background easily
just found this, which sounds v. interesting, will have to read the paper
https://www.youtube.com/watch?v=ZolWxY4f9wc
The Algorithm
The problem is that it will work well when you move near the camera. As you get further from the camera, the precision will drop fast.
yes
put the camera on the ball, and look for blinking light beacons in the anvironment
environment
you will also get orientation info from it
and the farther they are, the more precision you actually get
The problem is with any camera held by the user, it has to be oriented towards some reference to work. That limits the size of what you can create versus a ball on a stick pretty quickly. Also with putting multiple sources or points, then you have to deal with orientation feedback or the distance between your points is no longer your relative distance to the object.
A bigger ball would work and give you more accuracy at a greater distance.
I just liked the small size too. :)
button to select each color/turn on. On while held so you can stop your lines. Or select color via some interface then only light up when selected I guess.
Hmmm.. how about a tetrahedron made with multiple balls on each vertex. Then the depth cue could be garnered from that. Probably the same level of accuracy increase as just using a larger ball, but then you could get orientation of the 'brush' as well.
Or... if you are tracking multiple balls, when two are lit and the same color draw that as a plane in space.
I did something similar for detecting distance to target with the Creeper project using the distance between your eyes. It was only accurate out to about 10ft at acceptable framerate. Tracking an object like a lit ball is a whole lot easier though and real-time at much better framerates.
and resolutions.
ooo.. in the virtual representation, you could have bins or areas in 3D space where you could position the target to select other features like line width, patterns, etc.
I like the ball idea as well cause it puts the expensive bits remote from the user. You could literally use a flashlight, gels, and a ball to draw with no electronics needed on the end user side. Handing them out for an interactive thingy would not be cringe inducing.
I just had a flashback to the MS 3D pipes screensaver.