R/bp.R

bp <- function (img, i1, i2, w, K)
{
  w3 <- (w - 1)/2
  S <- vector(mode = "numeric", length = w^2)
  id <- 1
  for (j1 in (i1 - w3):(i1 + w3)) {
    for (j2 in (i2 - w3):(i2 + w3)) {
      S[id] <- spaCov(img, i1, i2, j1, j2, K)
      id <- id + 1
    }
  }
  sum(S^2)
}

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.