Learn R Programming

biopixR (version 1.1.0)

interpolatePixels: Pixel Interpolation

Description

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

Usage

interpolatePixels(row1, col1, row2, col2)

Value

Matrix containing the coordinates to connect the two input points.

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

Examples

Run this code
# 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()

Run the code above in your browser using DataLab