Skip to content

Instantly share code, notes, and snippets.

@lelap
Created July 31, 2015 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lelap/8cadc556e7a1b0a62746 to your computer and use it in GitHub Desktop.
Save lelap/8cadc556e7a1b0a62746 to your computer and use it in GitHub Desktop.
davinci image processing basic examples
Davinci http://davinci.asu.edu/ is a NASA-funded flight code software package used as a data processing tool, developed at Arizona State UNiversity by the Mars Space Flight Facility development team. Davinci providing powerful numeric data manipulation and spectral analytical tools and has a robust suite of tools designed to mosaic, normalize, register, and blend large datasets . The core of Davinci is a free, open-source C-like interactive and scripting language that relies on a math engine developed in C. Davinci has a variety of vector-oriented features that make working with large, complicated datasets much easier. Davinci is available as a prebuilt binary for all major operating systems (Windows, Mac, and Linux).
This is a basic example to test Davinci. This is based closley on GLG 490/598 remote sensing lab exercises developed by the PI of the ASU MSFF and Davinci - Dr. Philip Christensen, from 2010.
Follow the directions to get Davinci installed and running first: http://davinci.asu.edu/index.php?title=Download_Davinci
Obtain the tutorial emissivity file - a 5 band emissivity dataset:
http://mars.asu.edu/~phil/remote_sensing/lab_images/lab_images/granitewash_AST_11_16_01_emissivity.vic
In Davinci:
Read in a file into array ‘a’
dv> a = read("granitewash_AST_11_16_01_emissivity.vic")
Stretch and display all rows, all columns of band 2 in single step. To display: (must specify either 1 or 3 bands. Image must be in byte format).
dv> display(sstretch(a[,,2],ignore=0))
Plot all elements of the 100th row of band 3 of image ‘em’. Set y plot range to go from 0.8 to 1.02.
dv> pplot(a[ , 100, 3], y1 = .8, y2 = 1.02)
Plot the emissivity spectrum for pixel 130, 90
dv> pplot(a[130,90])
Perform a 7x7 boxcar (low-pass) filter on image ‘t’. Ignore zero values when doing the filter.
dv> b = boxfilter(a, 7, ignore=0)
Difference two images (or arrays). If ‘b’ was the original image and ‘a’ was a low-pass filter image, then ‘d’ would be a high-pass filtered image
dv> c = b - a
Compute histogram of all x and y elements in band 1 of image in 256 bins. The min and max values in the image are found automatically. The histogram value are in h[2]; the bin (x-axis) values are in h[1]. Ploting using pplot as shown plots the data in their true bins.
dv> h = histogram(b[ , , 1], steps=256)
dv> pplot(h[2], xaxis=h[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment