stereo-photogrammetry by hand


(jendrzych) #1

Well, I think it won’t be easy to expain my idea, because I don’t know how to upload pictures, but will try.

When You use blix camera calibration script there’s need to get some dimensions of real object. Sometimes it’s not possible to do it precisely enough or isn’t possible at all.

Some wise people invented some time ago a technique called stereo-photogrammetry. Using this technique (via sophisticated hardware and software) You can get exact dimentions of any objects having only stereo pairs of photos. All You have to know is: focal length of used camera; dimensions of used film/ccd sensor and distance between position of first shot and second one (parallel shots).

I’m an architect and often need to make a model of surroundings of space I work with, so I thought, that it could be nice to simulate stereo-photogrammetry in Blender to make my work easier and more efficient i.e. to get dimensions, that are hard or impossible to get on the spot, and moreover to have possibility of making any measurement I could need.

So I took two pictures of a table (stereopair), then launch Blendie, created two planes witch dimensions were exact dimensions of my camera sensor and distance betweet their centers equals distance between centres of my two shots. Next I UV-mapped them with taken pictures and in front of them, in the very centre of each one, I placed a camera which “f” was the same as I used to make those pictures. I had to set right relation between cameras and planes by hand – planes should exactly cover area bordered with dotted line (area masked with passepartout).
I mentioned this before, but it’s very important to make two perfectly parallel pictures, I mean that a certain specific point on both photos should lay on one horizontal line.
Now clue – I made line with one vert in left camera pyramid’s peak (I’ll call it “camera’s centre”) and second one on left plane surface. In orthogonal front view, in edit mode, I moved second vert to specific location (lets call it “point A”), than duplicate both of vertices and grab them to the right camera. Again highlighted second vert, but duplicated one this time (belonging to to pair “right camera – right photo”) and moved it horizontally to point the same specific “point A” on right photo. I got one object containing two edges (four vertices) one: “left camera’s centre – left photo’s point A”; second: “right camera’s centre – right photo’s point A” laying on one hypothetical surface. I just found an intersection of those edges using python script et voilà!
I repeated mentioned steps to find the rest of points needed to recover geometry of top of my table (55cm/55cm/45cm), and I got following measurements: 54.12; 53.88; 51.32; 56.59. Results aren’t very precise, but I think it’s quite impressive taking into consideration fact, that photos were not taken parallel enough – I did’t level my tripod at all.

I think it’d be nice to make a py-script to make this technique easier and cleaner – i.e. You could enter Your camera data, load pictures, point specific points on two photos (first one chosen freestyle, second have to be placed on horizontal line crossing first one) and script will recover it’s coordinates and create an empty. Than You can use those empties to calibrate at last two cameras and model whatever You want, UV-map it with photos… Clear photogrammetry. It’s just my dream, but I don’t know scripting at all (except GDL) and don’t have time to learn it, so maybe someone of You will try? What do You think about that?


(meestaplu) #2

Slick. I’m taking a computer vision class, and this sounds really cool. Which is the issue you’re having with images – do you need a web host, or do you need help uploading files on this site?

This sounds like something cool I might try. I have a digital camera and a tripod; now all I need is some time and a cool object to photograph!

It shouldn’t be too hard to write a Python script to do this, seeing as the Python API has drastically improved since I last used it. No promises, but if I find the time to try out your technique, I might go for a script.

Matt


(Spin) #3

Almost sounds like ICARUS.

I have taken home videos and imported them into ICARUS. ICARUS was able to get 100% motion tracking of the camera, based on my camera’s lens type and the type of video (freeHand or tripod).

With a Python script, I was able to get the X,Y,Z coordinates perfect and have the Blender Camera follow the exact movements of the original camera in the home video.

Notice that the glass (in the beginning of the clip) moves with the environment, perfectly in Blender.
Click here to watch AutoTrack-Glass

Here’s another test video. Camera is on the tripod, and the Blender model moves correctly with the camera. this one has SHADOWS, which is accomplished by creating some basic shaped meshes to match the foreground.
Click here to watch atDIVX


As lame as these videos are, I think there are better than some FX seen in movies a decade or two ago.

These video were my first attempts at doing such special FX. My VHS camcorder is quite crappy, which resulted many hours of calculations in ICARUS. A high Quality video will speed things up, since you can program ICARUS to use less tracking.


(MrMuscly) #4

WOW, that second one truly looked rea O.O


(jendrzych) #5

Briefly, cause I’m at work now.

Meestaplu - I neither have web host nor know how to upload files to Elysiun. Any help is welcome. Indirectly I could send You desired infos via e-mail (screenshots, pictures, blender’s data… etc.). It’d be great if You found some time to develop technique featured above.

Spin – I know Icarus, Voodoo etc. but those are camera trackers and I wanted to simulate so called stereoplotter (TIPHON i.e.). Resolution of images captured with video camera is just to low to be useful for UV mapping.


(Spin) #6

Hmmm… I remember when doing architectural drawings, they were hand drawn on white-board with black Rapid-O-Graph pen. Then colored with dyes, like water colors.

Oh, and the drawings were scaled from blue prints using a Lawson chart for perspective. I think the common one was Lawson Chart No. 7

The cost of a single drawing, back in the 1980’s was $250.00 for a normal sized residential house.