SyntheticTerrain:

Path: OpticalNavigation/Terrain

% SyntheticTerrain is a script created to create synthetic terrain
 Allan et al.'s work https://doi.org/10.1109/AERO.2019.8741780 to create a s
 terrain generator for the lunar surface to create high resolution images
 from the currently available low resolution images from http://imbrium.mit.edu/

 This script upscales the input image and outputs a synthetic higher
 resolution version of the input image:

 1. separates the high and low frequencies of the input image 
 2. performs fractal synthesis by the diamond-square method on the high
 frequency portion of the image and uses the Catmull-Rom spline
 interpolation method to generate new data
 3. performs bilinear interpolation on the low frequency component of the
 image
 4. recombines the high and low frequencies of the input image and returns
 the final image

 key input variables the user can change:

 c_img - the input image (this should be a dem but the script was mostly
 tested on optical images. may need different frequency splitting method 
 for low contrast dems avaialable.) the input image needs to be a square 
 with even # of pixels. I recommend starting with a small 500x500 image.

 scale - determines the upscaling of the input image. this needs to be a
 power of 2. i.e. scale = 2, 4, 8, 16 etc.

 freq - determines the frequency split between high and low frequencies.
 make use of the figure showing the frequency split to determine what the
 frequency should be for the input image. This needs to be between [0,1].

 interp - sets the interpolation method. by default this is 'spline' for
 Catmull-Rom Spline and 'linear', or linear interpolation, is only used on
 edge cases. However this can be changed to 'linear' for the entire image
 for comparison. This can only be 'spline' or 'linear'.

 key outputs:

 hmap - final heightmap. this is the upscaled input image. size will be
 scale*input image size

 method - matrix with indices indicating if a pixel was interpolated with
 the square or diamond method and the iteration number. 1:iter_max are
 squares for each iteration. iter_max+1:iter_max+iter_max are diamonds for
 each iteration. useful for debugging or for understanding final image
 artifacts.

 Online resources:

 Diamond-square method
 https://stevelosh.com/blog/2016/06/diamond-square/

 catmull rom spline
 https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline
--------------------------------------------------------------------------

Children:

OpticalNavigation: DataFiles/LunarSurfaceImage
OpticalNavigation: Terrain/CatmullRomSpline
Common: GUIs/Figui
Common: Graphics/NewFig
Common: Graphics/SortFigs
Common: Help/HelpSystem

Back to the OpticalNavigation Module page