Line Detection and 3-D endpoint recognition (cv.jit)

John J.A. Jannone's icon

Dear all,

What do you think is the best approach to find the 3-D endpoints of a line given two videos shot 90° perpendicular?

Here is what is happening: we're marking a violin bow with el-wire, and shooting a studio performance in order to create a long-exposure video (see vimeo.com/thenightbears/ for more information, and photo, attached).

Since we can do a 2-camera shoot, it seems likely we can extract 3-D data from the videos, and thereby add some openGL love to the project. I'm just a bit stumped as to how to start. I'm assuming I'll need cv.jit to recognize the lines in the first place, and I'm sure there is some handy math that allows two 2-D projections of a line to be converted into 3-D endpoint coordinates, but, please, I need a push in the right direction.

This does not need to be done in real-time; the performance will be recorded in the studio with a click-track, and the final long-exposure-video will be played back in concert. The current patch that creates the basic long-exposure video is very much non-real-time (despite using Gen...).

Many thanks for any advice!

John

elwire.jpg
jpg
Rob Ramirez's icon

not an answer, but have you considered using kinect? seems a hell of a lot easier.

John J.A. Jannone's icon

Hi Rob,

Unfortunately, the video is being shot in Vilnius, Lithuania. I'll receive it here in Osaka, Japan; so Kinect is not an option in this case ;<

Also, I'm curious about this problem conceptually -- this is the kind of 3-D vector stuff I'd like to get under by belt...

Hope you are very well!

John

John J.A. Jannone's icon

Ok -- I just figured this one out. It is ridiculously simple:

The output of cv.jit.lines from the front camera gives me x1,y1f and x2,y2f

The output of cv.jit.lines from the side camera gives me z1,y1s and z2,y2s

I'm solving for x1,y1,z1 and x2,y2,z2

If the cameras are equidistant, y1f=y1s=y1, and y2f=y2s=y1 (allowing for a little variation due to perspective distortion)

So, the answer is in the question. Love it when that happens.

John J.A. Jannone's icon

Although, if the perspective distortion does end up being a problem, any ideas about what to use to compensate? Is it the square law? Hmm.