Skip to content

rayheberer/imgnoise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imgnoise

The goal of imgnoise is to provide mathematicians and researchers with a convenient method for generating noise in images and other signals stored as arrays in R.

Currently, the four types of noise supported are Gaussian, Salt and Pepper, Speckle, and Uniform Noise.

Installation

You can install imgnoise from github with:

# install.packages("devtools")
devtools::install_github("rayheberer/imgnoise")

Example

This is a basic example which shows you how to implement gaussian noise.

## Loading an image
library(png)
logo = readPNG(system.file("img", "Rlogo.png", package="png"))
## Applying Noise
imgnoise(logo, "salt_and_pepper", noise_density = 0.1)

LogoSaltPepperNoiseDensityPoint1.png is the result.

For reference, the un-noised image:

Other Examples

imgnoise(logo, "gaussian")

imgnoise(logo, "gaussian", variance = 0.5)

imgnoise(logo, "salt_and_pepper")

imgnoise(logo, "speckle")

imgnoise(logo, "speckle", variance = 0.08)

imgnoise(logo, "uniform")

imgnoise(logo, "uniform", lower_bound = -0.5, upper_bound = 0.5)

Releases

No releases published

Packages

No packages published

Languages