This function will generate images of a specified type
simTexture(n = 256, sd = 1, K = 150, imtype = "S1", ...)
The dimension of the image to be generated.
The standard deviation of the increments of the LS2W process to be generated.
The number of images to generate.
The type of image(s) to create. Must be one of "S1","S2","S3","S4", "NS1","NS2", "NS3", "NS4","NS5","NS6", "NS7". See details for descriptions of the processes.
Any other optional arguments needed for the image generation (see details).
Several different processes can be generated with the
simTexture function. The stationary processes are: a random normal process of specified standard deviation,
S1); a spatial moving average process with parameter
S2); an isotropic random field with a Matern covariance with shape parameter
S3) and a diagonal Haar moving average process of a specified order
order and standard deviation
S4) (see the
Haar2MA.diag function in the
LS2W package for more details).
The nonstationary processes are: a random field with unit standard deviation on the first half-plane, concatenated with a random normal half-plane of standard deviation
NS1); a white noise half-plane concatenated with a Matern stationary process (
NS2); a Haar Montage of specified standard deviation
NS3) (see the
HaarMontage function for more details); a process with a slowly-varying covariance structure (
NS4); a white noise process with a central subregion of random Normal deviates with non-unit standard deviation
NS5); a white noise process with a subregion of random Normal deviates with non-unit standard deviation in the middle section of the top left quadrant
NS6); the final process is similar to
NS5, except that there is an additional texture in a subregion of the image. In other words, the image is a montage of three two-dimensional Normal processes with differing standard deviations. The base texture is again of unit variance, whereas the other two textures have standard deviations
The other optional arguments for
simTexture are as follows:
type - the type of neighbourhood dependence for the random field, either
"rook" (see the
cell2nb function documentation in the
spdep package for more details).
rho - moving average parameter for the process
nu - shape parameter for the Matern covariance for process
order - Haar moving average order for
start - start value for
NS4 (passed into
end - end value for
NS4 (passed into
a - "gradient" for
NS4 (passed into
prop - proportion of inserted subimage for
NS6 and the first subimage (
sd2 - standard deviation of second inserted subimage for
prop2 - proportion of second inserted subimage for
pos1 - position of first inserted subimage for
pos2 - position of second inserted subimage for
A list of length
Generating lots of images of high dimension may take a long time!
Note that as of version 2.1-4 (2022-05-09), textures S3 and NS2 have been temporarily removed (commented out) from the functionality of this function, due to a broken package (RandomFields).
Sarah L. Taylor and Matt Nunes
Matern, B. (1960) Spatial variation. Stochastic models and their application to some problems in forest surveys and other sampling investigations Meddleanden fran statens Skogsforskningsinstitut 49 (5).
Eckley, I.A., Nason, G.P., and Treloar, R.L. (2010) Locally stationary wavelet fields with application to the modelling and analysis of image texture Journal of the Royal Statistical Society Series C, 59, 595-616.
Taylor, S.L., Eckley, I.A., and Nunes, M.A. (2014) A Test of Stationarity for Textured Images. Technometrics, 56 (3), 291-301.
X1 <- simTexture(128,K=1,imtype="S4",order=3) X2 <- simTexture(128,K=1,imtype="NS4",fn=lincurve,a=.25,start=1,end=2) X3 <- simTexture(128,K=1,imtype="NS5",sd=1.6,prop=.25) X4 <- simTexture(128,K=1,imtype="NS7",sd=1.6,prop=.25,sd2=2.8, prop2=0.25, pos1=c(10,10),pos2="e") # try plotting the images: ## Not run: image(plotmtx(X1[]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.