mix2images: Insert one image into another.

Description Usage Arguments Details Value Author(s) References Examples

Description

Image A is re-sized to a specified proportion of Image B, then inserted into Image B at a given position.

Usage

1
mix2images(imageA, imageB, prop = 0.25, pos = "e")

Arguments

imageA

The first image which is resized and placed inside the second image.

imageB

The second image, into which the first is placed.

prop

The proportion of Image B to be taken up by Image A.

pos

The exact position of image A in image B. Possible options are "a", "b", "c", "d", "e" which corresponds to (a) top-right, (b) bottom-right, (c) top-left, (d) bottom-left and (e) centred. A more exact location may be specified by inputting pos=c(x,y), which represents the position in pixels from the top-left of the image (i.e. c(x,y) puts Image A x pixels down and y pixels across from the top-left corner of Image B.)

Details

This function first of all crops Image A to be a given proportion of Image B and then inserts it into image B at the specified location. If image B is too small for the size of image A required then the whole of image A is placed in image B. Both must be dyadic in length and square images.

Value

ImageB

A matrix with the specified values selected exchanged to those of Image A.

Author(s)

Sarah L. Taylor

References

Taylor, S.L., Eckley, I.A., and Nunes, M.A. (2014) A Test of Stationarity for Textured Images. Technometrics, 56 (3), 291-301.

Examples

1
2
3
4
5
6
7
8
9
# Generate 2 images.
#
ImageA <- matrix(rnorm(256^2), nrow=256, ncol=256)
ImageB <- matrix(rnorm(256^2, sd=2.8), nrow=256, ncol=256)
#
# Insert Image A into Image B at a proportion of 0.25
#
MixImaImb <- mix2images(ImageA, ImageB, prop=0.25, pos="e")
#

nunesmatt/LS2Wstat documentation built on May 15, 2019, 3:34 p.m.