Helper function
A helper function is provided for the fast approximation of the mean voxel reuse:
ImageQuilting.voxelreuse — Function
voxelreuse(trainimg::AbstractArray{T,N}, tilesize::Dims{N};
overlap::NTuple{N,Float64}=ntuple(i->1/6,N),
nreal::Integer=10, kwargs...)Returns the mean voxel reuse in [0,1] and its standard deviation.
Notes
The approximation gets better as nreal is made larger.
Keyword arguments kwargs are passed to iqsim directly.
Plot recipe
A plot recipe is provided for tile design in image quilting:
ImageQuilting.voxelreuseplot — Function
voxelreuseplot(trainimg; [options])Mean voxel reuse plot of trainimg.
Available options:
tmin- minimum tile size (default to7)tmax- maximum tile size (default tominimum(size(trainimg)))overlap- the percentage of overlap (default to 1/6 of tile size)nreal- number of realizations (default to 10)rng- random number generator (default toRandom.default_rng())color- color of the plot (default to:slategray3)
In order to plot the voxel reuse of a training image, install any of the Makie.jl backends.
] add CairoMakieThe example below uses training images from the GeoStatsImages.jl package:
using ImageQuilting
using GeoStatsImages
import GLMakie as Mke
img1 = geostatsimage("Strebelle")
img2 = geostatsimage("StoneWall")
dim1 = (size(domain(img1))..., 1)
dim2 = (size(domain(img2))..., 1)
trainimg1 = reshape(img1.facies, dim1)
trainimg2 = reshape(img2.Z, dim2)
voxelreuseplot(trainimg1)
voxelreuseplot!(trainimg2, color=:salmon)