interpolatePixels {biopixR}R Documentation

Pixel Interpolation

Description

Connects two points in a matrix, array, or an image.

Usage

interpolatePixels(row1, col1, row2, col2)

Arguments

row1

row index for the first point

col1

column index for the first point

row2

row index for the second point

col2

column index for the second point

Value

Matrix containing the coordinates to connect the two input points.

Examples

# Simulate two points in a matrix
test <- matrix(0, 4, 4)
test[1, 1] <- 1
test[3, 4] <- 1
as.cimg(test) |> plot()

# Connect them with each other
link <- interpolatePixels(1, 1, 3, 4)
test[link] <- 1
as.cimg(test) |> plot()

[Package biopixR version 1.1.0 Index]