Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. # Read the selected 'good' image sample file names
  2. sel.pics <- read.csv('sel-pict.csv')
  3. vvm.sel <- vvm$new(has.RGGB.pattern = TRUE)
  4.  
  5. # 'Digest' the samples computing noise related statistics
  6. vvm.sel$digest(
  7. file.name.from = sel.pics$pict,
  8. file.path = 'ISO100/Selection/crops'
  9. )
  10.  
  11. # Fit the usual model
  12. vvm.sel$fit.model(model.name = 'weighted', model.family = 'lmrob', weights=1/mean^2)
  13.  
  14. # Plot the var vs mean data
  15. vvm.sel$plot(with = ~ channel != 'Green Avg',
  16. tlab = "VVM Selected samples",
  17. slab = "Nikon D7000 - ISO 100")
  18.  
  19. # Plot the SNR vs gray scale (log) in dB
  20. imgnoiser.option('plot.point.opacity',0.3)
  21. add.snr.ref.limits(
  22. vvm.sel$plot(model.name = 'weighted',
  23. x = log10(mean/157.79), y = 20*log10(mean/sqrt(var)),
  24. tlab = "SNR Selected samples",
  25. slab = "Nikon D7000 - ISO 100",
  26. xlab = 'Gray scale (log)', ylab = 'SNR (dB)', print = FALSE,
  27. with = ~ channel != 'Green Avg') +
  28. scale_x_continuous(breaks=-1:2, labels=c('0.1%', '1%', '10%', '100%')) +
  29. scale_y_continuous(breaks=seq(0, 48, 4))
  30. )
  31.  
  32. # Plot the SNR vs gray scale in dB
  33. add.snr.ref.limits(
  34. vvm.sel$plot(model.name = 'weighted',
  35. x = (mean/157.79), y = 20*log10(mean/sqrt(var)),
  36. tlab = "SNR Selected samples",
  37. slab = "Nikon D7000 - ISO 100",
  38. xlab = 'Gray scale', ylab = 'SNR (dB)', print = FALSE,
  39. with = ~ channel != 'Green Avg') +
  40. scale_x_continuous(breaks = seq(0, 100, 20),
  41. labels=c('0%', '20%', '40%', '60%', '80%', '100%')) +
  42. scale_y_continuous(breaks=seq(0, 48, 4))
  43. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement