Description Arguments Value Examples
Assigns values to a VeloxRaster band from a matrix of flattened image patches.
Patch frames, as specified by rowframe and rowframe, are not assigned.
This function is intended to be used with mat matrices constructed with the im2col function.
mat |
The matrix of flattened image patches. |
wrow |
Patch size in the y dimension. |
wcol |
Patch size in the x dimension. |
band |
The band to be assigned. |
rowframe |
A non-negative integer specifying the size of the frame around the image patches in the y dimension. |
colframe |
A non-negative integer specifying the size of the frame around the image patches in the x dimension. |
rowstride |
A positive integer denoting the stride between extracted patches in the y dimension. |
colstride |
A positive integer denoting the stride between extracted patches in the x dimension. |
Void.
1 2 3 4 5 6 7 8 9 | ## Make VeloxRaster
mat <- matrix(1:100, 10, 10)
vx <- velox(mat, extent=c(0,1,0,1), res=c(0.1,0.1), crs="+proj=longlat +datum=WGS84 +no_defs")
## Apply im2col
patch.mat <- vx$im2col(wrow=2, wcol=2, band=1, padval=0,
rowframe=1, colframe=1, rowstride=2, colstride=2)
## Apply col2im
vx$col2im(mat=patch.mat, wrow=2, wcol=2, band=1, rowframe=1, colframe=1, rowstride=2, colstride=2)
isTRUE(all.equal(mat, vx$as.matrix()))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.