exams2nops
.
nops_scan( images = dir(pattern = "\\.PNG$|\\.png$|\\.PDF|\\.pdf$"), file = NULL, dir = ".", verbose = TRUE, rotate = FALSE, cores = NULL, n = NULL, density = 300, size = 0.029, threshold = c(0.04, 0.42), minrot = 0.002, string = FALSE)
file = FALSE
no
ZIP archive is created. By default a suitable name using the current time/date
is used.file
should be created.
By default the current working directory.mclapply
is
called internally using the desired number of cores
to read the scanned
exams in parallel.5
, 10
, ..., 45
. By default taken from the
type field.0.23
and 0.31
.nops_scan
is a companion function for exams2nops
.
Exams generated with exams2nops
can be printed and the filled out
answer page can be scanned. Then, nops_scan
can be employed to read
the information in the scanned PDF/PNG images. The results are one text line
per image containing the information in a very simple space-separated format.
If images
only contains PNG files, then the R function readPNG
is sufficient for reading the images into R. If images
contains PDF files,
these need to be converted to PNG first which requires PDFTk, GhostScript, and ImageMagick's
convert to be available on the system. On Linux(-esque) systems this is typically
easy to install by pdftk and imagemagick. The download links for Windows are:
http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_free-2.02-win-setup.exe,
http://www.imagemagick.org/script/binary-releases.php#windows,
http://www.ghostscript.com/download/gsdnld.html.
Practical recommendations:
The scanned images produced by scanners or copying
machines typically become smaller in size if the images are read in just black/white
(or grayscale). This may sometimes even improve the reliability of reading the
images afterwards.
The printed exams are often stapled in the top left corner which has to be unhinged
somehow by the exam participants. Although this may damage the exam sheet, this is
usually no problem for scanning it. However, the copying machine's sheet feeder
may work better if the sheets are turned upside down (so that the damaged corner
is not fed first into the machine). This often improves the scanning results
considerably and can be accomodated by setting rotate = TRUE
in nops_scan
.
exams2nops
, nops_eval
## scanned example images stored in exams package
img <- dir(system.file("nops", package = "exams"), pattern = "nops_scan",
full.names = TRUE)
## read content
res <- nops_scan(img, file = FALSE)
writeLines(res)
Run the code above in your browser using DataLab