This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MenuHandler.prototype.buildMenu = function(menuObj, MaxLevels, currLevel, basePath) { | |
var menu = "", menuItem, className, extraTitle; | |
for (var childMenuKey in menuObj) { | |
menuItem = ''; | |
className = ''; | |
extraTitle = ""; | |
if ( !/[^\-—–\s]/.test( menuObj[childMenuKey].menu ) ) | |
menuItem = '---'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1) Read and digest the channels with valid values | |
vvm.all <- vvm$new(has.RGGB.pattern = TRUE) | |
vvm.all$digest( | |
file.name.from = '_ODL0387s4', | |
file.name.to = '_ODL1671s6', | |
file.name.ext = '.pgm', | |
file.path = 'ISO100/crops', | |
min.raw = 4, | |
max.raw = c(16379, 15774, 15774 ,16379)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(imgnoiser) | |
vvm.all <- vvm$new(has.RGGB.pattern = TRUE) | |
vvm.all$digest(file.name.from = '_ODL0387s4', | |
file.name.to = '_ODL1671s6', | |
file.name.ext = '.pgm', | |
file.path = 'ISO100/crops', | |
min.raw = 4, # <= Raising this limit to avoid the funny red tail | |
max.raw = c(16379, 15776, 15776 ,16379)) | |
# Fit a quadratic, weighted, robust model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert selected raw images to a given destinations space | |
# without demosaicing | |
convert.to.rgb <- function(target.space, | |
use.camera.tc, | |
target.tc, | |
cam.coldata = imgnoiser::nikon.d7000.ISO100.colmap, | |
dest.scale = 255 | |
) { | |
library(imgnoiser) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hvm.all <- hvdvm$new(has.RGGB.pattern = TRUE) | |
hvm.all$digest(photo.conds.file = 'ISO100/crops/full-set.csv', | |
crop.files.path = 'ISO100/crops', | |
min.raw = 4, | |
max.raw = c(16379, 15774, 15774 ,16379)) | |
# Fit a quadratic model | |
hvm.all$fit.model(model.name = 'weighted', | |
model.family = 'lmrob', | |
degree = 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read the selected 'good' image sample file names | |
sel.pics <- read.csv('sel-pict.csv') | |
vvm.sel <- vvm$new(has.RGGB.pattern = TRUE) | |
# 'Digest' the samples computing noise related statistics | |
vvm.sel$digest( | |
file.name.from = sel.pics$pict, | |
file.path = 'ISO100/Selection/crops' | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the LR tifs var data | |
tif.var.zero <- vvm.tif$var.df | |
# Rename 'mean' and 'var' columns to avoid later name colision in merging | |
names(tif.var.zero)[3:4] <- paste0('tif.', names(tif.var.zero)[3:4]) | |
# Remove sample file name extension to make possible the merge by picture file name | |
tif.var.zero$pict <- substr(tif.var.zero$pict, 1, 8) | |
# Compute the linear sRGB values | |
vvm.rgb.lin <- convert.to.rgb(target.space = 'sRGB', use.camera.tc = FALSE, target.tc = 'linear') | |
# Get the sRGB linear wide var data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Plot log-log of LR and our camera tone curves | |
ggplot(lin.rgb.and.tif) + | |
geom_point(aes(x = (mean)/255, y = tif.mean.cam/255, | |
group = channel, colour = channel), | |
size = 1.5) + | |
ggtitle('LR Camera tone curve\nFor Nikon D7000') + | |
xlab('linear sRGB gray (log10)') + ylab('LR camera TC sRGB gray (log10)') + | |
scale_x_log10() + | |
scale_y_log10() + | |
geom_line(aes(x=x, y=y), data=my.cam.tc, color='darkblue', linetype='dashed') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vvm.rgb <- convert.to.rgb(target.space = 'sRGB', use.camera.tc = FALSE, target.tc = 'linear') | |
x11() | |
vvm.rgb$plot(tlab = "VVM Selected samples in linear sRGB", | |
slab = 'Without camera tone curve') | |
vvm.rgb$plot(x = log2(mean), y = 20*log10(mean/sqrt(var)), | |
tlab = "SNR Selected samples in linear sRGB", | |
slab = 'Without camera tone curve', | |
xlab = "Signal (stops)", xlim=c(-1.5,8), | |
ylab = "SNR (dB)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(imgnoiser) | |
library(ggplot2) | |
# Y coordinate of sRGB primaries. From http://en.wikipedia.org/wiki/SRGB | |
weights.sRGB <- c(0.2126, 0.7152, 0.0722) | |
# D65 white point in XYZ. From ASTM E308-01 in http://www.brucelindbloom.com/ | |
D65.XYZ <- c(0.95047, 1.00000, 1.08883) | |
# With "D65 color matrix" in the camera color data, we can convert | |
# the D65 XYZ white point to the camera raw color space: | |
D65.raw <- nikon.d7000.ISO100.colmap$cam.matrices.2$color.matrix %*% D65.XYZ | |
#> [,1] |
OlderNewer