Overlay data and colorize
Line 37: | Line 37: | ||
[[Image:color_overlay3.png]] | [[Image:color_overlay3.png]] | ||
− | Create an overlay array. Add 50% of the color of the night_time_col to day_time. | + | Create an overlay array. Add 50% of the color of the night_time_col to day_time. We chose a value of 50% arbitrarily, adding more will result in a picture with stronger color. |
Davinci will automatically copy the 1-band day_time image to each color band of night_time_col*0.5 | Davinci will automatically copy the 1-band day_time image to each color band of night_time_col*0.5 |
Revision as of 15:56, 8 December 2006
Contents: Description, Procedure, Functions Used
Description Overlay two data images using one to color the other. This example overlays day time Themis IR with colorized night time Themis IR of the same region on Mars.
Procedure Load in the two images: dv> day_time = read("day_time.cub") 279x300x1 array of byte, bip format [83,700 bytes] dv> night_time = read("night_time.cub") 279x300x1 array of byte, bip format [83,700 bytes] Display the data dv> display(day_time) dv> display(night_time) Colorize the night_time data dv> night_time_col = colorize(night_time) 255,000,255 = 0.000000 000,000,255 = 51.000000 000,255,000 = 102.000000 255,255,000 = 153.000000 255,128,000 = 204.000000 255,000,000 = 255.000000 279x300x3 array of byte, bip format [251,100 bytes] dv> display(night_time_col) Create an overlay array. Add 50% of the color of the night_time_col to day_time. We chose a value of 50% arbitrarily, adding more will result in a picture with stronger color. Davinci will automatically copy the 1-band day_time image to each color band of night_time_col*0.5 dv> overlay = night_time_col*0.5 + day_time 279x300x3 array of float, bip format [1,004,400 bytes] Now, because the overlay array may have values exceeding 255 if turned directly into byte, causing some pixels to be oversaturated, we sstretch the array, rescaling it from 0 to 255. dv> overlay = sstretch(overlay) 279x300x3 array of byte, bip format [251,100 bytes] dv> display(overlay)
|
DavinciWiki Mini-Nav Bar Contents
Contact Developers
All other topics
|