OneWhiteEye
18th October 2007 - 06:53 AM
On the matter of scaling from pixels to meters:
My preference is to produce many different numbers through a variety of methods. Ideally, they would agree fairly closely but, if they don't, discarding outliers would be reasonable and there may be reasons for choosing one over the others remaining or just composing them into a single number.
There is also a tiered quality of measurements. A quick scale factor obtained easily is better than none but there's no reason to retain it if there's a provably better number available later.
The simplest method for the subject video was to measure a number of floors, so I did that right away and nothing since. The obvious shortcoming for antenna data is that the wall is not at the same depth, however the degree of error would be expected to be small because of the apparent distance of the camera.
How many floors to measure, and where? A span of many floors measured to a given accuracy means the error per pixel is small BUT it also assumes the distance per floor in the image plane is the same across large regions, which is generally not the case in either the horizontal or vertical dimension. Because the perspective in this video presents a fairly true image, there's not a BIG difference in the apparent height of floor 90 and floor 100 - but there IS a difference. All the more so for the same true distance interval on the antenna, a less obvious source of error than depth as mentioned above, but also being because of depth.
I went for 18 floors, the largest vertical stretch of floors of uniform height I could measure, given the constraints of the image quality and condition of the wall.
How to measure a floor? Discovering the answer to this firsthand was one of the more distasteful aspects of the work so far. The image quality and perspective make it difficult to distinctly placemark the seams(?) on the facade, forget about windows or any of that. Smoke and soot stains irregularly extend the height (thickness) of the lines, which span 4-5 pixels vertically in the image. Once again, a picture tells more about it than I can:
http://i23.tinypic.com/dfef86.jpg(big version)
David B. Benson: If you can't see anything here but the lines I've added, join the club. I've needed glasses for some time but haven't bothered to get them yet - and that alone goes a long way towards justifying +/-2 or more pixels right there, doesn't it? Might I suggest turning the light off? I'm turning mine off now, it makes it much easier to see. Contrast adjustments and the like don't help as much as it would seem they should, plus I'm leery of running a reference frame through any filter I didn't code myself, and I only have so much time.
The
top of the green line terminates at bottom of one of those seams. Now, if you look down at the bottom of the green line, you'll see (or maybe you won't see) the line also terminates at the bottom of one of those seams:
http://i24.tinypic.com/5drtz5.jpgObserve the end of the line is not flush with the bottom of the lowest dark pixel of the seam, whereas the other end is very nearly flush with the bottom of the associated seam. Before I present a rock-solid justification for these placements, allow me to note that, if I had it to do over again, I almost certainly wouldn't put them in the same place.
Using a vector graphics editor, the frame image can be blown up to any degree desired and lines can be drawn to the precision allowed by the monitor/pointing device at that zoom. Placing a point at sub-pixel resolution is therefore trivial but doing so meaningfully is not. Had I opted to use a bitmap editor, my placement would be only to the nearest pixel and easily justified as such. However, with the power to place anywhere comes the responsibility of doing so according to some rhyme, and here's mine:
The upper seam has a very dark bottom pixel row over the region where the measurement ends, indicating the feature does not 'bleed down' (a wholly inaccurate but sufficient term) into the row below. Without any other factors, that would have me place the end of the line flush with the bottom boundary of the dark pixel row extrapolated from either side. The dark area of the seam extends a little lower to the right of where the green line intersects, so I lowered the endpoint just a tad to account for that since, if my line happened to be there, I'd be stopping lower.
The lower seam has a bottom row that is lighter, not as sharp a boundary, so I placed the endpoint roughly in the middle of that pixel instead of all the way down. The idea is to hit the same place on two seams that might not have projected the same on a good day with a great still camera, anyway.
Then there is the matter of how to draw the line. Really. Is anyone still with me to this point? Because I have far more sophisticated and boring ideas of how to do this much more accurately and by script (another post another day).
If you just draw a vertical line, you'll intersect at different horizontal locations on each floor. Start in the right place and go high enough, you'll almost run off the building into the sky. No, true vertical is not vertical in this image plane, so I decided to draw from floor to floor along the angle representing true vertical - as you go up the side of the building at that particular lateral location. As best as I could. I'd say within a half-pixel at either end.
Finally, the resulting vector output into an SVG file was (532.3115, 466.4453) - (528.4312, 207.7784), the vertical component being 258.6669.