Skip to content
Open

Ocr #424

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
dc92fef
Update README.md
atarix83 Dec 12, 2016
47b791e
Update README.md
atarix83 Dec 12, 2016
4e776c3
Added ocr branch files
atarix83 Dec 12, 2016
fd67963
modified README.md
atarix83 Dec 12, 2016
c6ac3fc
Update bower.json
atarix83 Dec 12, 2016
16a814e
Update bower.json
atarix83 Dec 12, 2016
ef76ff1
Update bower.json
atarix83 Dec 12, 2016
9e7cac1
Update README.md
atarix83 Dec 12, 2016
b351e8a
build updated
atarix83 Jan 4, 2017
6e5fa7e
Merge branch 'ocr' of https://github.com/4Science/universalviewer int…
atarix83 Jan 4, 2017
61303cf
build updated
atarix83 Jan 9, 2017
5ca8f6b
Hostname configurable in Gruntfile.js
atarix83 Feb 3, 2017
c917af4
Merge remote-tracking branch 'upstream/master' into ocr
atarix83 Feb 10, 2017
2c67bc6
Merge remote-tracking branch 'upstream/master' into ocr
atarix83 Feb 10, 2017
20b3874
Merge remote-tracking branch 'upstream/master' into ocr
atarix83 Feb 16, 2017
038d858
Gruntfile.js changed
atarix83 Feb 16, 2017
e72ba09
Merge branch 'master' of https://github.com/UniversalViewer/universal…
atarix83 Feb 16, 2017
4f798eb
Merge branch 'master' of https://github.com/UniversalViewer/universal…
atarix83 Apr 14, 2017
320ac92
Add logo image to footer
atarix83 Apr 18, 2017
c237a6c
Merge remote-tracking branch 'remotes/origin/master' into ocr
atarix83 Apr 18, 2017
9c9caaa
Merge remote-tracking branch 'remotes/origin/master' into ocr
atarix83 Apr 18, 2017
71adc43
Merge last commits
atarix83 Apr 18, 2017
85539fd
Add "contributed by" text to settings dialogue
atarix83 Apr 18, 2017
4c0b66f
Fix async image load issue
atarix83 Apr 18, 2017
f0f9d5b
Merge remote-tracking branch 'remotes/origin/logo' into ocr
atarix83 Apr 19, 2017
6fcc3b8
Merge remote-tracking branch 'remotes/origin/logo' into ocr
atarix83 Apr 19, 2017
631ee83
Add configuration parameter for more info website
atarix83 Apr 19, 2017
34751d8
Add logo and contributor information
atarix83 Apr 19, 2017
e38055e
Remove logo padding
atarix83 Apr 19, 2017
4c8a6ea
Update build
atarix83 Apr 19, 2017
b75b8b7
Fix position logo onLoad
atarix83 Apr 19, 2017
64c48a2
Merge remote-tracking branch 'remotes/origin/logo' into ocr
atarix83 Apr 19, 2017
77121ed
Update build
atarix83 Apr 19, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ module.exports = function (grunt) {

global:
{
bases: [__dirname],
hostname: 'localhost',
minify: 'optimize=none',
port: '8001'
},
Expand Down Expand Up @@ -360,8 +362,9 @@ module.exports = function (grunt) {
dev: {
options: {
port: '<%= global.port %>',
base: '.',
directory: '.',
hostname: '<%= global.hostname %>',
base: '<%= global.bases %>',
directory: '<%= global.bases %>',
keepalive: true,
open: {
target: 'http://localhost:<%= global.port %>/<%= config.directories.examples %>/'
Expand Down
83 changes: 82 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,86 @@
# Universal Viewer
# Universal Viewer (with OCR module)

This is a fork from Universal Viewer that implements a new OCR module.

## What is the OCR module?

The OCR module render a new right panel where you can find the text extracted from the viewed image, retrieved from a web-annotation service.

## Functionality

OCR module allows to show, in a new right panel, the text extracted from the viewed image by an OCR Software (e.g. Tesseract).
Moreover you can highlight the text within the OCR panel finding it on the image.
The highlighted text is rendered like searching with the footer panel search.

![Demo Screenshot](http://uvdemo.4science.it/screenShotDemo01.jpg "Demo Screenshot")

## Examples

Try a live demo here : http://uvdemo.4science.it

## How to enable the OCR module

For using the OCR module you need to add a new service in your manifest :

"service": [
...
{
"@context" : "http://www.w3.org/ns/anno.jsonld",
"@id" : "{ocrservice-id}",
"profile" : "http://4science.it/api/ocr/0/annotationCollection",
"label" : "OCR"
}
]

See http://uvdemo.4science.it/manifest/hamlet for an example manifest.

## How does it works?

The annotation server respond with an annotation collection described as below :

{
"@context": [
"http://www.w3.org/ns/anno.jsonld"
],
"@id": "{ocr-service-id}?q={canvas-id}",
"type": "AnnotationCollection",
"label": "Page OCR",
"total": 184,
"first": {
"id": "{ocr-service-id}/annotationPage?q={canvas-id}#ltr",
"type": "AnnotationPage",
"startIndex": 0,
"items": [
{
"id": "{item-id}#word_1_1",
"type": "Annotation",
"body": {
"type": "TextualBody",
"value": "64",
"format": "text",
"textDirection": "ltr"
},
"target": [
"{canvas-id}#xywh=107,83,16,13",
"{canvas-id}#area=block_1_1",
"{canvas-id}#paragraph=par_1_1",
"{canvas-id}#line=line_1_1"
]
}
]
}
}

The server response is parsed by the new module and showed as a text rapresentation of the viewed image.

[Next steps]

- Enable editing of each single annotation (eg. single word recognized by the OCR software) from the user interface;
- Create a new annotation by drawing it over the image.

# Universal Viewer

[![Build Status](https://travis-ci.org/UniversalViewer/universalviewer.svg?branch=master)](https://travis-ci.org/UniversalViewer/universalviewer) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/UniversalViewer/universalviewer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/UniversalViewer/universalviewer.svg?branch=master)](https://travis-ci.org/UniversalViewer/universalviewer)
&nbsp;&nbsp;
<a href="https://universalviewerinvite.herokuapp.com"><img src="https://worldvectorlogo.com/logos/slack.svg" width="60" /></a>
Expand Down
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"dependencies": {},
"devDependencies": {
"uv-cy-GB-theme": "universalviewer/uv-cy-GB-theme",
"uv-en-GB-theme": "universalviewer/uv-en-GB-theme"
"uv-cy-GB-theme": "4Science/uv-cy-GB-theme",
"uv-en-GB-theme": "4Science/uv-en-GB-theme"
}
}
}
17 changes: 9 additions & 8 deletions dist/uv-2.0.1/lib/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/uv-2.0.1/lib/uv-seadragon-extension.cy-GB.config.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/uv-2.0.1/lib/uv-seadragon-extension.en-GB.config.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2189,6 +2189,13 @@ input[type=range]:focus::-ms-fill-upper {
cursor: pointer;
left: 35px;
}
#app .rightPanel .top .clearSel {
position: absolute;
height: 20px;
margin-top: 9px;
cursor: pointer;
right: 5px;
}
#app .rightPanel .top .collapseButton {
position: absolute;
background: url('../../img/uv-shared-module/arrows_right.png') no-repeat;
Expand Down Expand Up @@ -2243,6 +2250,10 @@ input[type=range]:focus::-ms-fill-upper {
margin-right: 10px;
margin-bottom: 10px;
}
#app .rightPanel .main .wordHighlightDiv {
padding-left: 5px;
padding-right: 5px;
}
#app.browser-Explorer.browser-version-8 .rightPanel .closed .title {
writing-mode: tb-lr;
}
Expand Down Expand Up @@ -2462,6 +2473,27 @@ input[type=range]:focus::-ms-fill-upper {
color: #fff;
text-decoration: none;
}
#app .footerPanel .options a.logo {
background-image: url('../../img/footer_logo.png');
background-repeat: no-repeat;
height: 21px;
line-height: 21px;
cursor: pointer;
color: #fff;
text-decoration: none;
background-position: left center;
padding-left: 0;
padding-right: 10px;
line-height: 22px;
position: absolute;
}
#app .footerPanel .options a.logo:link,
#app .footerPanel .options a.logo:visited,
#app .footerPanel .options a.logo:hover,
#app .footerPanel .options a.logo:active {
color: #fff;
text-decoration: none;
}
#app .footerPanel .options a.print {
background-image: url('../../img/uv-shared-module/print.png');
background-repeat: no-repeat;
Expand Down Expand Up @@ -2586,6 +2618,16 @@ input[type=range]:focus::-ms-fill-upper {
width: 27px;
padding: 0;
}
#app .footerPanel .options.minimiseButtons a.logo {
font: 0/0 a;
text-shadow: none;
background-color: transparent;
border: 0;
line-height: 0;
font-size: 0;
color: transparent;
padding: 0;
}
#app .footerPanel .options.minimiseButtons a.print {
font: 0/0 a;
text-shadow: none;
Expand Down
42 changes: 42 additions & 0 deletions dist/uv-2.0.1/themes/uv-cy-GB-theme/css/uv-pdf-extension/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -3045,6 +3045,13 @@ input[type=range]:focus::-ms-fill-upper {
cursor: pointer;
left: 35px;
}
#app .rightPanel .top .clearSel {
position: absolute;
height: 20px;
margin-top: 9px;
cursor: pointer;
right: 5px;
}
#app .rightPanel .top .collapseButton {
position: absolute;
background: url('../../img/uv-shared-module/arrows_right.png') no-repeat;
Expand Down Expand Up @@ -3099,6 +3106,10 @@ input[type=range]:focus::-ms-fill-upper {
margin-right: 10px;
margin-bottom: 10px;
}
#app .rightPanel .main .wordHighlightDiv {
padding-left: 5px;
padding-right: 5px;
}
#app.browser-Explorer.browser-version-8 .rightPanel .closed .title {
writing-mode: tb-lr;
}
Expand Down Expand Up @@ -3318,6 +3329,27 @@ input[type=range]:focus::-ms-fill-upper {
color: #fff;
text-decoration: none;
}
#app .footerPanel .options a.logo {
background-image: url('../../img/footer_logo.png');
background-repeat: no-repeat;
height: 21px;
line-height: 21px;
cursor: pointer;
color: #fff;
text-decoration: none;
background-position: left center;
padding-left: 0;
padding-right: 10px;
line-height: 22px;
position: absolute;
}
#app .footerPanel .options a.logo:link,
#app .footerPanel .options a.logo:visited,
#app .footerPanel .options a.logo:hover,
#app .footerPanel .options a.logo:active {
color: #fff;
text-decoration: none;
}
#app .footerPanel .options a.print {
background-image: url('../../img/uv-shared-module/print.png');
background-repeat: no-repeat;
Expand Down Expand Up @@ -3442,6 +3474,16 @@ input[type=range]:focus::-ms-fill-upper {
width: 27px;
padding: 0;
}
#app .footerPanel .options.minimiseButtons a.logo {
font: 0/0 a;
text-shadow: none;
background-color: transparent;
border: 0;
line-height: 0;
font-size: 0;
color: transparent;
padding: 0;
}
#app .footerPanel .options.minimiseButtons a.print {
font: 0/0 a;
text-shadow: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2075,6 +2075,13 @@ input[type=range]:focus::-ms-fill-upper {
cursor: pointer;
left: 35px;
}
#app .rightPanel .top .clearSel {
position: absolute;
height: 20px;
margin-top: 9px;
cursor: pointer;
right: 5px;
}
#app .rightPanel .top .collapseButton {
position: absolute;
background: url('../../img/uv-shared-module/arrows_right.png') no-repeat;
Expand Down Expand Up @@ -2129,6 +2136,10 @@ input[type=range]:focus::-ms-fill-upper {
margin-right: 10px;
margin-bottom: 10px;
}
#app .rightPanel .main .wordHighlightDiv {
padding-left: 5px;
padding-right: 5px;
}
#app.browser-Explorer.browser-version-8 .rightPanel .closed .title {
writing-mode: tb-lr;
}
Expand Down Expand Up @@ -2348,6 +2359,27 @@ input[type=range]:focus::-ms-fill-upper {
color: #fff;
text-decoration: none;
}
#app .footerPanel .options a.logo {
background-image: url('../../img/footer_logo.png');
background-repeat: no-repeat;
height: 21px;
line-height: 21px;
cursor: pointer;
color: #fff;
text-decoration: none;
background-position: left center;
padding-left: 0;
padding-right: 10px;
line-height: 22px;
position: absolute;
}
#app .footerPanel .options a.logo:link,
#app .footerPanel .options a.logo:visited,
#app .footerPanel .options a.logo:hover,
#app .footerPanel .options a.logo:active {
color: #fff;
text-decoration: none;
}
#app .footerPanel .options a.print {
background-image: url('../../img/uv-shared-module/print.png');
background-repeat: no-repeat;
Expand Down Expand Up @@ -2472,6 +2504,16 @@ input[type=range]:focus::-ms-fill-upper {
width: 27px;
padding: 0;
}
#app .footerPanel .options.minimiseButtons a.logo {
font: 0/0 a;
text-shadow: none;
background-color: transparent;
border: 0;
line-height: 0;
font-size: 0;
color: transparent;
padding: 0;
}
#app .footerPanel .options.minimiseButtons a.print {
font: 0/0 a;
text-shadow: none;
Expand Down
Loading