Learn R Programming

Rvision (version 0.4.2)

addWeighted: Weighted Sum of Two Images

Description

This function computes the weighted sum of two Image objects.

Usage

addWeighted(image1, image2, weight = c(0.5, 0.5))

Arguments

image1

An Image object.

image2

An Image object.

weight

A 2-element vector of the respective weight of each image (default: c(0.5, 0.5)). If the two weights do not add up to 1, they will be rescaled accordingly.

Value

An Image object.

See Also

Image

Examples

Run this code
# NOT RUN {
balloon1 <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
balloon2 <- image(system.file("sample_img/balloon2.png", package = "Rvision"))
plot(addWeighted(balloon1, balloon2))

# }

Run the code above in your browser using DataLab