Description Usage Arguments Value See Also Examples
The haze factor for a given RGB array.
1 | getHazeFactor(rgbArray, mu = 5.1, nu = 2.9, sigma = 0.2461)
|
rgbArray |
RGB array (W x H x 3) where the third dimension contains R, G and B channels, values varying from 0 to 1. |
mu |
function parameter |
nu |
function parameter |
sigma |
function parameter |
a list of two numeric values:haze as haze degree and A0 as the global atmospheric light
getDarkness
, getBrightness
and getContrast
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | library(jpeg)
img <- readJPEG(system.file("img", "Rlogo.jpg", package="jpeg"))
h <- getHazeFactor(img)
d <- getDarkness(img)
b <- getBrightness(img)
c <- getContrast(img)
par(mfcol = c(2, 2), mar = c(0.5, 0.5, 0.5, 0.5))
plotRGBArray(img)
mtext(text = 'RGB', side = 3, line = -2, adj = 0.05, font = 2, col = 'red')
mtext(text = paste0('Hazeness: ', signif(h$haze, 2)), side = 1, line = -2, adj = 0.05)
mtext(text = paste0('A0: ', signif(h$A0, 2)), side = 1, line = -1, adj = 0.05)
plotRGBArray(d)
mtext(text = 'Darkness', side = 3, line = -2, adj = 0.05, font = 2, col = 'red')
plotRGBArray(b)
mtext(text = 'Brightness', side = 3, line = -2, adj = 0.05, font = 2, col = 'red')
plotRGBArray(c)
mtext(text = 'Contrast', side = 3, line = -2, adj = 0.05, font = 2, col = 'red')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.