Computes the center of gravity (COG) of character-like binary images using three different methods. This package provides functions for estimating stroke-based, contour-based, and potential energy-based COG. It is useful for analyzing glyph structure in areas such as visual cognition research and font development. The contour-based method was originally proposed by Kotani et al. (2004) < https://ipsj.ixsq.nii.ac.jp/records/36793> and Kotani (2011) < https://shonan-it.repo.nii.ac.jp/records/2000243>, while the potential energy-based method was introduced by Kotani et al. (2006)
coglyphr is an R package for computing the center of gravity (COG) of character-like binary images using three different methods. This package provides functions for estimating stroke-based, contour-based, and potential energy-based COG. It is useful for analyzing glyph structure in areas such as visual cognition research and font development.
The current version supports the following COG computation methods:
cog_stroke)cog_contour), based on the method proposed by Kotani and colleagues (2004, 2011)cog_potential), based on the method proposed by Kotani and colleagues (2006)For details on each function, refer to the function references.
The stable release of coglyphr is available on CRAN:
install.packages("coglyphr")
You can also install the development version from GitHub:
# Install devtools if not already installed
if (!requireNamespace("devtools", quietly = TRUE)) install.packages("devtools")
# Install coglyphr
devtools::install_github("mutopsy/coglyphr")
cimg or when returning results as cimg.After installation, you can load this package using the library function.
library(coglyphr)
Please cite the following preprint when using this package. Although this work is released as a preprint, it represents the final version and will not be submitted elsewhere.
Muto, H. (2025). coglyphr: An R package to compute glyph centers of gravity from image data. Jxiv. https://doi.org/10.51094/jxiv.1531
See the Changelog on pkgdown site for the full changelog.