R/mbChange.R

Defines functions mbChange

Documented in mbChange

mbChange <- function(img, alpha = 1) {

  if (!is.matrix(img)) stop("img must be a matrix!")

  nr <- nrow(img)
  nc <- ncol(img)
  newImg <- img
  for (i in 1:nc)
    newImg[2:nr,i] <- (1 - alpha*(i-1)/nc)*newImg[2:nr,i] + alpha*(i-1)/nc*newImg[1:(nr-1),i]

  return(newImg)
}

Try the spc4sts package in your browser

Any scripts or data that you put into this service are public.

spc4sts documentation built on May 24, 2022, 5:07 p.m.