Description Usage Arguments Details Value Author(s) References Examples
Extracts the skeleton of a black and white image (that is, represented by a matrix).
1 |
matrix |
A numeric matrix, representing the black and white image (a pixel of value |
The skeletonisation algorithm implemented is based on Stentiford (1983). It is a recursive thinning process that allows to extract a curve with a thickness of 1 pixel.
A matrix with values of 1
for the contour and values of 0
for the background.
Alexandre Thiery
F.W.M. Stentiford, R.G. Mortimer (1983), "Some new heuristics for thinning binary handprinted characters for OCR." IEEE Transactions on Systems, Man and Cybernetics, 13, pp. 81-84.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
## We use the 'fig-O.png' example image available in this package
file = system.file("extdata", "fig-O.png", package = "ForensicDocument")
## Read the image using 'ImageRead' method, or (similarly with 'png::readPNG')
image1 = ForensicDocument:::ImageRead(file, character_pixel = 0)
## Create the image skeleton
image2 = ForensicDocument:::ImageThin(image1)
par(mfrow = c(1,2))
image(t(image1), xlim = c(0,1), ylim = c(1,0), col = c("white", "black"),
main = "Original Image", asp = 1)
image(t(image2), xlim = c(0,1), ylim = c(1,0), col = c("white", "black"),
main = "Skeleton Image", asp = 1)
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.