stego_lm_hide.RdConstructs a regression dataset whose residual plot reveals a hidden image. Based on the method by Staudenmayer & Stefanski. The image is converted to a binary (black/white) scatter of points, then embedded into the structure of a linear regression.
stego_lm_hide(path, size = 100, cutoff = 0.5, coef.det = 0.05, p = 5, M = 100)path to an image file (png/jpg/bmp), or a cimg object
resize the image to this width/height in pixels before converting to binary. Smaller values run faster. Default 100.
threshold for binarisation (0-1). Pixels darker than this become scatter points. Default 0.5.
target R-squared of the fake regression. Default 0.05.
number of predictor columns in the output data frame. Default 5.
number of border points per edge for orthogonalisation. Default 100.
A data.frame with columns Y, X1, ..., Xp.
Fitting lm(Y ~ ., data = result) and plotting fitted vs
residuals reveals the hidden image.
if (FALSE) { # \dontrun{
dat <- stego_lm_hide("photo.png")
stego_lm_reveal(dat)
} # }