Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

Writing Video 3D Modeler?

writing 3D video modeler scene

  • Please log in to reply
2 replies to this topic

#1 RhetoricalRuvim


    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1311 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 09 August 2012 - 11:28 AM


I want to write a modeler program that will construct 3D models of a scene from a regular video file; I know it's not possible to completely reverse-engineer a video into a 3D model, but I want this to at least generate the model parts that can be derived from the video.

I need more information as for how to start or approach this. Currently I'm thinking the program should scan the video frame by frame, looking at two consecutive frames at a time and comparing the two frames' pixels to find where motion just happened and where what got moved. Then the program should map that information to a buffer of colored, 3-dimensional points. After this whole video scanning I think it should find a way to put those points into a model(/s).

Is my idea of this correct?

I want this to work on Windows, and I don't care that much about whether it works on other operating systems. Are there any good video libraries for reading frames from a video file? Or can the Win32 AviFile API work here (but limited to AVI input)?

Thanks in advance.
  • 0

#2 gregwarner


    Obi Wan of Programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1586 posts
  • Location:Arkansas
  • Programming Language:C, Java, C++, C#, PHP, Transact-SQL

Posted 09 August 2012 - 11:49 AM

Let me just start by saying this is a very complicated task you are thinking about undertaking. Motion extrapolation from video and extrapolation of 3d geometry from perspective are two different and complex tasks.

Extrapolating motion from video is not a simple matter of comparing pixels. Yes, you are working on pixel data, but you must consider groups of pixels which match a similar pattern. You'll need fuzzy logic to "find" the same object in one frame as you found in another, because its position, and thus shape (perspective), has shifted. Not to mention lighting changes from frame to frame, causing color changes, and also image noise.

MPEG-4 video compression already does quite a bit of motion analysis in order to separate moving parts from the background, thereby reducing the need to update the background as frequently as the more interesting parts. Perhaps you can use some of the research from this to get started.

Also, there are programs out there which extrapolate geometry from one or more photos. I don't know of any of their names off hand, but I've played with a few of them in the past, with mixed results. Try looking at what's been done in this field and see if you can adapt it to your idea. Just keep in mind, you're in for a long ride if you see this through to completion.
  • 0

Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid

#3 CodeTiger


    CC Regular

  • Member
  • PipPipPip
  • 25 posts
  • Programming Language:Java, C++, C#, JavaScript, Lua
  • Learning:Objective-C

Posted 25 August 2012 - 02:21 AM

Yes, it's very very complex. Just to find the object is very hard...then you need the distance to create 3d model and so on...and then checking the motion...I don't know for what you need it, or wheter it is just a exercise,
but I wouldn't start with it...You'll get on a point where it will not work as well as you want..And it will take a lot of time...I would say too much for just one person..
  • 0

Also tagged with one or more of these keywords: writing, 3D, video, modeler, scene

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download