Description Usage Arguments Details Value Author(s) Examples
View source: R/ExtractFourier.R
This method allows to extract fourier parameters (i.e. An and Bn parameters) from closed shapes present in images.
1 2 | ExtractFourier(files, n.fourier = 8, n.samp = 128, skeletonize = TRUE,
character_pixel = 0, output, verbose = TRUE)
|
files |
A vector of string, giving the images' filenames to analyse. |
n.fourier |
A integer, giving the number of harmonics (or fourier parameters) to extract. |
n.samp |
A integer, giving the number of points to subsample the closed shape. |
skeletonize |
A logical value, indicating if the character should be skeletonized. |
character_pixel |
A integer value (0 or 1), indicating which pixel value is from the character (see details). |
output |
A string, giving the name of the output file. See details. |
verbose |
A logical value, indicating if progress is to be printed on the console. |
The vector containing the images' filenames, the file
argument, is pre-processed before the analysis. Duplicated file names and files that do not exists that are discared.
character_pixel
is a integer value, either 0 or 1, it indicates which pixel value is from the character. For example, if character_pixel = 1
then pixels that have a value of 1
will correspond to the character, and pixels that have a value of 0
will correspond to the background.
If output
is missing, it returns a list of matrices (one for each files
), containing the extracted An and Bn values. Otherwise, the results are printed in a csv file (one record or row for each image).
Alexandre Thiery
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
## Example using a sample character O from Marquis et al.
## In this image, black pixels are from the character (value of 0),
## and white pixels are from the bakcground (value of 1). The
## character is not skeletonized, thus we use skeletonize = TRUE.
## We will consider a re-sampling size of the character's skeleton of
## 128 (n.samp = 128). All of the Fourier parameters will be extracted,
## thus n.fourier = n.samp / 2 = 64.
file = system.file("extdata", "fig-O.png", package = "ForensicDocument")
image = ExtractFourier(files = file, n.fourier = 64, n.samp = 128,
skeletonize = TRUE, character_pixel = 0)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.