Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Quack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
commul
Zeit.shift
Quack
Commits
1527ef1b
Commit
1527ef1b
authored
11 years ago
by
Toke Eskildsen
Browse files
Options
Downloads
Patches
Plain Diff
Closes #19 (Add OCR quality statistics): The reported accuracy is shown on the image page
parent
96e555e0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
image_template.html
+2
-1
2 additions, 1 deletion
image_template.html
quack.sh
+2
-1
2 additions, 1 deletion
quack.sh
with
4 additions
and
2 deletions
image_template.html
+
2
−
1
View file @
1527ef1b
...
@@ -26,7 +26,8 @@ ${ALTERNATIVES}
...
@@ -26,7 +26,8 @@ ${ALTERNATIVES}
<p
class=
"greystats"
>
<p
class=
"greystats"
>
${GREY_FIRST}: ${GREY_PERCENT_FIRST}%
<br/>
${GREY_FIRST}: ${GREY_PERCENT_FIRST}%
<br/>
${GREY_LAST}: ${GREY_PERCENT_LAST}%
<br/>
${GREY_LAST}: ${GREY_PERCENT_LAST}%
<br/>
Unique greyscale values: ${GREY_UNIQUE}
Unique greyscale values: ${GREY_UNIQUE}
<br/>
ALTO-accuracy: ${ACCURACY}%
<p><input
type=
"checkbox"
id=
"toggle_grid"
onClick=
"toggleGrid();"
>
Grid
</input></p>
<p><input
type=
"checkbox"
id=
"toggle_grid"
onClick=
"toggleGrid();"
>
Grid
</input></p>
<p><input
type=
"checkbox"
id=
"toggle_textblock"
checked=
"checked"
onClick=
"toggleTextBlock();"
>
TextBlocks
</input></p>
<p><input
type=
"checkbox"
id=
"toggle_textblock"
checked=
"checked"
onClick=
"toggleTextBlock();"
>
TextBlocks
</input></p>
<p><input
type=
"checkbox"
id=
"toggle_blown"
onClick=
"toggleBlown();"
>
Black/white
</input></p>
<p><input
type=
"checkbox"
id=
"toggle_blown"
onClick=
"toggleBlown();"
>
Black/white
</input></p>
...
...
This diff is collapsed.
Click to expand it.
quack.sh
+
2
−
1
View file @
1527ef1b
...
@@ -467,7 +467,7 @@ function blackWhite() {
...
@@ -467,7 +467,7 @@ function blackWhite() {
# Generates overlayscase
# Generates overlayscase
# src dest altofile width height
# src dest altofile width height
# Output: ELEMENTS_HTML OVERLAYS OCR_CONTENT IDNEXT_CONTENT FULL_RELATIVE_HEIGHT
# Output: ELEMENTS_HTML OVERLAYS OCR_CONTENT IDNEXT_CONTENT FULL_RELATIVE_HEIGHT
ACCURACY
function
processALTO
()
{
function
processALTO
()
{
local
SRC
=
"
$1
"
local
SRC
=
"
$1
"
local
DEST
=
"
$2
"
local
DEST
=
"
$2
"
...
@@ -499,6 +499,7 @@ function processALTO() {
...
@@ -499,6 +499,7 @@ function processALTO() {
local
PTAG
=
`
echo
"
$ALTO_COMPACT
"
|
grep
-o
"<Page[^>]
\\
+>"
`
local
PTAG
=
`
echo
"
$ALTO_COMPACT
"
|
grep
-o
"<Page[^>]
\\
+>"
`
local
PHEIGHT
=
`
echo
$PTAG
|
sed
's/.*HEIGHT=\"\([^"]\+\)".*/\\1/g'
`
local
PHEIGHT
=
`
echo
$PTAG
|
sed
's/.*HEIGHT=\"\([^"]\+\)".*/\\1/g'
`
local
PWIDTH
=
`
echo
$PTAG
|
sed
's/.*WIDTH=\"\([^"]\+\)".*/\\1/g'
`
local
PWIDTH
=
`
echo
$PTAG
|
sed
's/.*WIDTH=\"\([^"]\+\)".*/\\1/g'
`
ACCURACY
=
`
echo
$PTAG
|
sed
's/.*ACCURACY=\"\([^"]\+\)".*/\\1/g'
`
FULL_RELATIVE_HEIGHT
=
`
echo
"scale=6;
$PHEIGHT
/
$PWIDTH
"
| bc |
sed
's/^\./0./'
`
FULL_RELATIVE_HEIGHT
=
`
echo
"scale=6;
$PHEIGHT
/
$PWIDTH
"
| bc |
sed
's/^\./0./'
`
# TODO: Ponder how relative positioning works and why this hack is necessary
# TODO: Ponder how relative positioning works and why this hack is necessary
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment