getHazeFactor: The haze factor for a given RGB array.

Description Usage Arguments Value See Also Examples

Description

The haze factor for a given RGB array.

Usage

1
getHazeFactor(rgbArray, mu = 5.1, nu = 2.9, sigma = 0.2461)

Arguments

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

Value

a list of two numeric values:haze as haze degree and A0 as the global atmospheric light

See Also

getDarkness, getBrightness and getContrast

Examples

 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')

hazer documentation built on May 2, 2019, 2:42 a.m.