Enables calculation of image textures (Haralick 1973)
The glcm
package enables calculating image textures derived from grey-level
co-occurrence matrics (GLCMs) in R. The texture calculation is coded in C++
to optimize computation time. The glcm
function in the package can compute
the following texture statistics: mean (using either of two definitions),
variance (using either of two definitions), homogeneity, contrast,
dissimilarity, entropy, second_moment, and, correlation. The window size,
shift, and grey-level quantization are user determined. See the help file for
glcm
(included in the package) for details.
To install the latest stable version of glcm
from
CRAN, fire up R and run:
install.packages('glcm')
glcm
Development VersionIf you want the very latest version of glcm
, you can install the development
version. Be aware this version might not install as it is not as well tested as
the stable version.
NOTE: If you are installing on Windows, you will need to install the
appropriate version of Rtools
for your version of R (as glcm
contains C++ code) before you follow the below
steps.
The easiest way to install the development version of the glcm
package is
using the
devtools
package by Hadley
Wickham. After installing devtools
from CRAN, type:
library(devtools)install_github('azvoleff/glcm')
Alex Zvoleff
Postdoctoral Associate
Tropical Ecology Assessment and Monitoring (TEAM) Network
Conservation International
2011 Crystal Dr. Suite 500
Arlington, VA 22202
USA
Add doi reference to DESCRIPTION file where methods for package are referenced.
Added executable example in glcm.Rd that doesn't require loading the raster package (which is not required).
Added an executable example in calc_texture.Rd.
Update for new r requirement of registration of symbols (added init.c).
Use https for CRAN urls in docs per CRAN requirements.
Docs for "glcm" stated that the default direction was 90 degrees. This is incorrect - the default is 45 degrees. Fixed docs accordingly.
Fix error that arose when handling large images due to usage of "stack" from wrong namespace in "glcm" function. Thanks to Wenjuan Shen, Dennis O. Ojwang', and others for reporting.
Fix handling of images small enough to process as a single block.
Fix case of very small final block.
Misc doc fixes and CRAN check fixes.
Support calculation of average textures over multiple shifts (glcm in "all directions". Thanks to Matthias Weigand for testing.
Automatically process rasters block-by-block when cannot process in memory.
Thanks to Santosh Bhandari for testing.
Upgrade to roxygen2 > 4.0.2.
Various minor doc fixes.
Fix proj4string for example image.
Upgrade to roxygen2 > 4.0.0.
Reformat tests for testthat
>= 0.8.
Fix handling of window sizes other than 3 x 3 (issue #2).
Rename test image to end in 3x3_1x1 (as it was run with a 3x3 window size and 1 row x 1 column shift).
Add additional test cases.
Add additional validation of user input to "glcm" function.
Update website address.
Various fixes to docs.
Require Rcpp >= 0.11.0 (as Makevars and Makevars.win are no longer included in package).
Minor fixes to docs.