1 Efficient rendering of terrain elevation model
3 start with some top level cells
9 views from google earth
11 image data + info viewing / illumination
16 projection of imagery is not linear lon/lat
17 use gdal library to open file and get projection, and translate between projections
18 found another source of elevation data
19 3arcsec srtm with voids filled in using high resolution relief maps
20 1arcsec same format but made before the above with same maps
21 higher res, but SRTM is more accurate
22 elevation interpolation
23 tried bilinear and bicubic
28 [ ] comparing two regions in different datasets
29 [ ] get source from shadow guys
32 using discontinuity measure with mid range IR
33 mir lights up rocks not in shadow, so discontinuity *(1-mir) could work
34 initially working with discontinuity measurement
35 saturation screws up with a lot of it
36 its then that i realised that of course shadow is never saturated
37 any saturated area can be discounted as non-shadow
38 shadows are generally dark throughout the channels
39 so multiply by (1- each channel value)
40 low (unsnowed) vegetation still shows up as shadow
41 is that because its shadows in the complexity of trees etc?
42 these areas have accurate SRTM data
43 perhaps we can use this to prove that they cannot be in shadow
44 characteristics of a cast shadow as travel away from light
46 area of self shadow - we can find this from the elevation data
49 therefore an area of light followed by an area of shadow
50 without self shadow in between is false
54 simple, per pixel towards light until hits terrain
56 edges of sun visibility projected into floor
59 negative product might not work as with rgb, but quite good here
60 doesn't work well in non snowy areas
61 constraints transititions along light path of illuminated, self shadow, cast shadow
64 shadow classification isn't great using simple method
65 we could use some PAT techniques
66 features could be log chromaticity values
67 classifications are shadow/non-shadow
68 could restrict to only pixels negative-product classifies as shadow
70 menu export->condition in selection
71 condition is channel and threshold (=0.5)
72 list of available channels
73 list of output channels
74 buttons to transfer between, and move up and down
75 generalised negative product
76 now product of powers of negative channels
77 can bias channels, so thermal IR has more effect at eliminating shadows than the others
80 [ ] improve shadow classification using self-shadow -> cast-shadow constraint
81 [ ] start terrain improvements
85 [X] error function in terms of parameters
86 [ ] find derivitive (numerically)
88 [X] threshold as another parameter or minimise threshold each step
89 [ ] could plot wavelength - importance to shadow classification
90 [X] whether throwing away channels would help - minimiser would solve
91 [ ] test that constraint equations hold on training data (russion relief maps)
92 [ ] take some lines in direction of sun, and do the plot
93 [ ] smooth out small variations between shadow types
94 [ ] ambient occlusion with hemispheres
95 [ ] "shape from shading on a cloudy day"
96 [ ] shape from shading - two images - intersection of cones
97 [ ] scatter plot between angle and colour in shadows
98 [ ] look good on report
99 [ ] lit review before christmas
103 hold off on thresholding
104 error = number of incorrect classifications
105 as threshold goes from 0 to 1, crossing a pixel value
106 pixels in shadow go incorrect
107 pixels in light go correct
108 create a number of bins in range, e.g. for each slider value
109 single pass through pixels
110 if classified as shadow: +1 to bin
111 as threshold hits that value, error will increase
112 if classified as non-shadow: -1 from bin
113 as threshold hits that value, error will decrease
116 gradient descent comes up with something like:
117 threshold: 2.47319e-6
118 0.9, 1.2, 0.8, 2.6, 19.5, 14, 10.7, 8.5, 3.3
119 when adapted to larger terrain, optimal threshold is: 1.8692e-6
121 another gradient descent:
122 threshold: 0.000581442
123 0.1, 0.8, 0.9, 0.9, 15.8, 7.2, 6.2, 6.9, 2.8
127 added elevation channel, showing void
128 when change lambertian shading to light from top, and go high resolution
129 do voids appear darker, i.e. significantly steeper?
130 there's definitely some relationship, but its not entirely accurate
134 about 6 papers per section
136 any attempt at estimation
137 Edwin did radar shape from shading
138 "francot" "chalaper" - surface integration
139 shape from shading from snow covered terrain
143 section on data sources
147 try gradient descent on big terrain area
148 check if it holds generally
150 normal angle to sun / value
151 normal z component / value
154 shadow edge dictionary - low level (finding edges) -> higher level (meaning)
156 will ?[cg]ause? any problem
157 tree/graph/finite state automata
158 tree of allowed rules
159 Consistency - what to do when not
161 confidence in how good
164 general rules - state machine
165 do sample - check consistent
170 change of height values (appropriately scaled)
172 shadow entrance constraints
173 difference of gradients to tangential
174 (-dh/dw - sin(elev_sun))^2
175 negative change in gradient
177 elevation relative to transition exit, from elevation of sun
178 (h_exit+(w_enter-w_exit)*sin(elev_sun) - h)^2
179 total rate of change of gradient (smoothness) in both directions
182 shadow elevation constraint - below line between entrance and exit
183 (max(0, h - (h_exit*(w_exit-w) + h_enter*(w-w_enter)) / (w_exit-w_enter)))^2
184 lit pixels must be facing the sun
185 min(0, -dh/dw - sin(elev_sun))^2
186 angle between normals and shape-from-shading/occlusion normals
187 factoring in reliability of shape-from-shading (e.g. snow/rock)
189 quick access to a pixel's sun direction shadow entrance/exit
190 elevation field upsampled to match imagery?
193 [ ] plot theta(N,L)/I to check shading is accurate
194 for shadow and non shadow
195 should look like cos in sun
196 tell us albedo (x=0), reflection when face on
197 [ ] what shape for shadow region?
198 integrate over L for occlusion
199 imagine hemisphere on surface (slanted)
200 the bottom part is cut off (horizon)
201 -- we integrate from one side to the other, across the slope
202 -- integrate the L.N across the points in the arc of a circle
203 albedo*L*int(0,pi, int(theta,pi, L.N dx) dy)
205 -- L is (cos(x)*sin(y), cos(y), sin(x)*sin(y))
206 -- L.N = sin(x)*sin(y)
207 albedo*L*int(0,pi, int(theta,pi, sin(x)*sin(y) dx) dy)
208 -- sin(y) doesn't depend on x
209 albedo*L*int(0,pi, sin(y)*int(theta,pi, sin(x) dx) dy)
210 -- int sin(x) dx = -cos(x)
211 albedo*L*int(0,pi, sin(y)*[-cos(pi)+cos(theta)] dy)
213 albedo*L*int(0,pi, sin(y)*[1+cos(theta)] dy)
214 -- [1+cos(theta)] doesn't depend on y
215 albedo*L*[1+cos(theta)]*int(0,pi, sin(y) dy)
216 albedo*L*[1+cos(theta)]*[-cos(pi) + cos(0)]
217 -- cos(pi) = -1, cos(0) = 1
218 albedo*L*[1+cos(theta)]*2
220 2*albedo*L*(1+cos(theta))
223 so to implement the above cost function, we need at each pixel:
224 current elevation (turn into height map)
225 gradient in light directions
226 rate of change of gradient in x, y, light direction
227 whether classified as shadow, or lit
228 whether on a boundary of shadow and light
229 sun elevation and direction
231 distance to and current elevation at shadow entrance and exit in light direction
234 now we have shadow depth channel in each direction
235 new channel to optimise elevation
236 must be able to take multiple datasets
237 also adjusts corrected elevation values in DEM
239 previous elevation (internal)
240 shadow classification, shadow depths
243 We really need to know distances accurately
246 can calculate short distances easily, given radius
247 can convert to texture space
249 can convert to geographical
250 can't directly calculate distances
251 ideally need to optimise in a geographical texture space
253 19:13 - tried with roughness, variance, lit facing and travision elev
254 hard to get coefficients right so that it does the smoothing
255 better result when learning rate is constant
258 earlier in the week got all channels into geographical space, resampled
259 on loading. this should make it more convenient to optimise using multiple
261 now updates digital elevation model with optimisation
262 now need to get optimisation improved!
265 [ ] graphs lit/nonlit
267 "shadow segmentation"
270 "elevation correction"
272 "correction of terrain elevation data using shadow segmentation of multispectral imagery"
273 "fine scale correction of terrain elevation data using terrain imagery"
274 [ ] statement of ethics talk by alistair
275 [ ] elevation correction
276 [ ] tackling wall problem
277 [ ] intermediate smoothing
278 [ ] start at low resolution, and increase resolution as we get closer
279 [ ] moving blocks of pixels at a time
280 [ ] when moving pixels, move others in range, like blender does
283 used falloff function when editing verticies
284 gaussian is very very slow
285 linear is much faster, still slow, but converges faster than before
286 massive dip on each side because forgot to max(0,x)
287 overshoots because no constraint to keep shadow areas below shadow line
288 add shadow line constraint - not working yet, pushing terrain down
291 landsat 5 data now loads
292 need to make it possible to work on multiple datasets
294 [X] add groups to ColourMapWidget
295 simple addGroupSeparator(const QString& name)
296 [X] global channel manager for optimisation and terrain channels
297 [X] elevation optimisation of multiple image datasets
298 [ ] fix export to work on multiple datasets
301 works on multiple datasets, slowly
302 new problem, not updating textures during mid-optimization refresh
304 [ ] for each weight, also have constant/increase/decrease option
306 [ ] setting for linear falloff limit
308 [ ] keep DEM in memory when switching
309 [ ] save corrected values
311 [ ] simplify - corrected values are separate DEM (primary, secondary)
312 [X] select primary and secondary DEM
313 [ ] void-fill performed on primary DEM
314 [ ] corrections written to secondary DEM
315 [ ] initialised with new secondary DEM copied from primary
316 [ ] new elevation data
317 [ ] select custom resolution
318 [ ] copy from another DEM
319 [X] select to display primary or secondary DEM, OR...
320 [X] compare primary, secondary DEM
321 [O] slider with partial updating of textures too (periodically)
322 [ ] channel to compare primary and secondary
325 need to get on with write up
326 added DEM comparison channel - allows quantitative comparison of std deviation
327 John Clark in CRY L10 Non standard cracking
328 when optimizing, make problem harder to get better results
329 in context of perceptron problem
330 move boundary of punishment so values are further from border and
331 less likely to cross it again soon
332 may be very unlikely to solve strict problem but gives us better
333 solution to our problem in the process
334 Negative product optimization implications
335 instead of error being number of incorrect pixels
336 error is sum distance on wrong side of boundary
337 e.g. if np=0.2, shadow, th=0.3, err=th/np=3/2
338 [ ] could also try simulated anealing
341 got more image datasets with much lower solar elevation
342 very pronounced shadows (a bit too big in fact!)
343 haven't tried optimizing yet
344 ideally need to get a good set of different solar positions
345 plot solar positions in 2d plot to show variation
346 it also occurred to me that for the purposes of testing the algorithm
347 could generate shadow classification directly from raytracing with
348 some specially chosen sun direction (pretending we've done the
349 shadow classification correctly on some fictional image dataset)
350 e.g. to get a higher azimuth than 160deg, its always morning atm
353 hard constrain to hard set some elevations from shadow constraints
354 works well at reducing standard deviation
355 accompanied by a bilinear filtering to reduce peaks
358 found blackart - uses GTOPO30 data in interpolation, and gets better results
359 cannot compare unless I also use GTOPO30 data
360 easy way to accomplish this is if I export the elevation data
361 read in data using blackart and see if the result is improved
364 scale intensity so brightest pixel is 1
367 ACCV 07 - videoed sun shadows over day
368 shape reconstruction from cast shadows using coplainarities and metric constraints
370 spectrum under mouse as graph or histogram
373 choose axis functions (linear, acos)
376 optimization working well, downloaded some cgiar data (a good interpolation method)
377 void std deviation down by over 25%
378 overall std deviation down by over 20%
379 non-void tends to stay about the same
380 results of shadow comparisons pretty good
381 time to get some hard results
382 [X] record (and load) exact lon lat selection
383 [X] graph of error decreasing
384 [ ] cross-section of ridge decreasing
385 [X] snapshot terrain at intervals
386 [ ] snapshot viewport at intervals
389 optimization from basic
390 optimization from cgiar
393 [ ] seems - not important
394 [ ] when creating texture for region, don't up sample, select larger area
395 [ ] bilinear/bicubic filtering at edge of SRTM tile results in ridges
399 [X] selection of channels to display
400 [ ] more sensible sampling of elevation data
401 [X] edges of box should interpolate
402 [X] inner vertices should be sensible
404 [X] basic linear interpolation
405 [X] spline interpolation
406 [X] gui to toggle {flat, unprocessed, corrected -> refined}
407 [ ] self shadow lines
408 [ ] different colours for ridges and valleys
410 [X] focus extended altitude
411 [X] mouse click -> lon lat transformation
412 [ ] terrain grab while dragging
413 [X] selection of region
414 [ ] region image preview (full resolution)
415 [ ] multiple viewports
416 [ ] interaction (observers) can be locked together
417 [ ] data view can be locked together
419 [ ] should be able to add processing bands to those on the colour mapper
420 [X] input bands should be derivable from digital elevation model
421 e.g. could do calculations in world space instead of texture space
422 [X] get texture space normal at a pixel
423 [X] get texture space lighting direction at a pixel
424 [X] get elevation at a pixel
425 [X] get geographical coordinate at a pixel
428 [X] lambertian shading (automatic self shadow detection)
429 [ ] combination of the two (pixel product)
430 [ ] chromaticity based on lambertian shading shows colour
432 [X] in region, detect shadow areas
434 [X] from elevation data using raytracing
436 [ ] border and highlight in both views
441 8401 x 7461 - 63MB x6
442 4201 x 3731 - 16MB x2
443 16801 x 14921 - 250MB x1
446 downsample entire image to a reasonable size
447 1/8 x 1/8 = 1/64th size = ~10MB
448 or use the thumbnail in each image
449 when a portion of the image is desired in higher detail
450 reload portion of the image at full resolution
451 1/8 x 1/8 = 1/64th size of image
452 when a portion of the image is no longer being used
464 image data should be made up of channels
465 some channels are source bands from GeoTIFF files
466 some are derived from other channels
468 manages a set of channels that are referred to in a colour map widget
470 functionality for keeping data around so as not to have to reload
471 after creating GL texture
472 results can be floating point, bytes, bits
473 histograms and various plots based on the pixel data
474 data changed event triggers invalidation of textures
475 and invalidation of channels derived from this channel
476 tcChannelConstant : tcImageChannel
477 constant colour - e.g. black (for a null channel to avoid clicking rgb each time)
478 tcChannelFile : tcImageChannel
479 data from a GeoTIFF file
481 acts on a number of input channels to produce a number of output channels
482 can be configured with a gui
483 tcChannelProcessChromaticity : tcChannelProcess
484 divide a set of channels by another channel or a value
486 tcChannelProcessIlluminantInvariant : tcChannelProcess
487 input log chromaticities
488 can configure illuminant direction
489 if two dimentions, use a dial
490 for > 2 dimentions, select a shadow / non shadow adjascent bit of image
491 or select multiple such known shadow changes and average
492 find variation vector from this
493 easy to reuse this vector
494 tcChannelProcessIlluminantDiscontinuity : tcChannelProcess
496 shows discontinuity between adjascent pixels in x or y direction
497 i.e. you might show two of these in different colour channels
500 determine if we need to subdivide quality in this cell
501 if we're close, then we do
502 find distance from each corner
503 use distance[i] < max(dist(corner[i], corner[j]))*factor
504 if we should subdivide
505 renderCell on each of the 4 subdivisions
506 determine the quality at this level
507 find distance to center
508 apply magic function to find detail level
509 render the cell in this detail level