## Glider photogrammetry

Tuesday, July 3rd, 2018 at 7:50 pm

We had a go, where I rigged my U2 hang-glider in the front garden with the VG full on to make it rigid, and then standing it on its nose so that JR could take lots of nice high definition photos of it from a variety of angles with a proper camera with a big lens.

The Agisoft Photoscan thing initially got it right, with a good looking 3D image: But then I started doing things with the point scan — in particular finding its symmetry so as to compare the left wing with the right wing.

The code is here.

Basically, I loaded the 9653216 points from the csv file with this one Python command:

`k = pandas.read_csv("hg1a1b.txt", sep=" ", names=["x","y","z","r","g","b","nx","ny","nz"])`

And then worked out that I could perform vector calculations on the columns of coordinates, like this

```# Reflect about the plane through x=2 parallel to the YZ plane
mv = pandas.Series({"x":2, "y":0, "z":0})
mvsq = sum(mv**2) # (scalar)
mvfac = (k.x*mv.x + k.y*mv.y + k.z*mv.z)*2/mvsq - 2  # 9million value column
kmirr = pandas.DataFrame({"x":k.x-mv.x*mvfac, "y":k.y-mv.y*mvfac, "z":k.z-mv.z*mvfac})
```

The alternative more memory efficient calculation method, performed row by row runs many, many times slower:

`kmirr = k.apply(lambda R:R[["x","y","z"]] - mv*((R.x*mv.x+R.y*mv.y+R.z*mv.z)*2/mvsq - 2), axis=1)`

In any case, have produced an animation melting through from one wing tip to the other, like so:

It seems that one wing is much fatter in depth than the other.

I think this is a photogrammetry error in its understanding of how far apart to put both sides of the wing. The gap at the leading edge on the fatter wing gives it away.

As is my observation in freeform CAD/CAM: you can get away with a lot of deviation from the required surface because no one can tell when it’s wrong. They can measure the flatness of the square edges, but errors in the middle of the freeform surface (so long as they are smooth) pass without notice. I suspect a lot of photogrammetry works on that principle. It’s only when we scanned something with two sides that was supposed to be symmetrical could I tell there was a big a problem.

(To be fair, the Agisoft failed when we reran it to get a better fit. It is better to

Well, so much for that. I had hoped I’d have something good enough to trace up and enter into XFLR5 as a series of contours, but it’s not quite.

However, I should just make up a series of contours based on this anyway (since it has things like the washout/twist approaching the wingtips) so that when we get good data (eg from a laser scanner) we are all ready for it.