GenImg {KoulMde} | R Documentation |
Generate black-and-white images
Description
Create various images such as circle, rectangle and random dots.
Usage
GenImg(nx, ny, Type = 1, bNoise = FALSE, sig_noise = 0.1)
Arguments
nx |
- Width of an image. |
ny |
- Length of an image. |
Type |
- Type of an image: 1, 2, and 3 for rectangle, circle, and random dots, respectively. |
bNoise |
- Option for including noise: TRUE or FALSE. |
sig_noise |
- Strength of noise: numeric value between 0 and 0.5. |
Value
A list of information of a generated image.
ImgMat - a matrix whose entries are pixel values of a generated image.
S1 - an n1x2 matrix whose entries denote coordinates of white pixels of the image. n1 denotes the number of the white pixels.
S2 - an n2x2 matrix whose entries denote coordinates of black pixels of the image. n2 denotes the number of the black pixels.
Examples
######## Generate a 10x10 black-and-white rectangle image with some noise
nx=10
ny=10
Type=1
bNoise=TRUE
sig_noise=0.1
lst = GenImg(nx,ny,Type, bNoise, sig_noise)
ImgMat = lst$ImgMat
image(ImgMat, axes = FALSE, col = grey(seq(0, 1, length = 256)))
[Package KoulMde version 3.2.1 Index]