* demo/xml2doc/templates/html/main.xsl,
* demo/xml2doc/templates/html/main_base64.xsl: Here.
---
scribo/ChangeLog | 7 ++++
scribo/demo/xml2doc/templates/html/main.xsl | 31 ++++++++++++-------
scribo/demo/xml2doc/templates/html/main_base64.xsl | 31 ++++++++++++-------
3 files changed, 45 insertions(+), 24 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index e4dc651..e18a1c5 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,12 @@
2012-09-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Take OCR confidence into account in HTML reconstruction.
+
+ * demo/xml2doc/templates/html/main.xsl,
+ * demo/xml2doc/templates/html/main_base64.xsl: Here.
+
+2012-09-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* src/afp/components.hh: Rename index_of_point to offset_of_point.
2012-09-07 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/scribo/demo/xml2doc/templates/html/main.xsl
b/scribo/demo/xml2doc/templates/html/main.xsl
index 8c51ed2..bbd7a5a 100644
--- a/scribo/demo/xml2doc/templates/html/main.xsl
+++ b/scribo/demo/xml2doc/templates/html/main.xsl
@@ -245,19 +245,26 @@
</xsl:choose>
</xsl:variable>
+ <!-- Display lines with high enough OCR confidence -->
+ <xsl:choose>
+ <xsl:when test="@textConfidence > 60">
+
+ <span class="line">
+ <xsl:attribute name="style">
+ height:auto;
+ font-size:<xsl:value-of select="$fsize" />px;
+ width:<xsl:value-of select="$x2 - $x1" />px;
+ left:<xsl:value-of select="$x1 " />px;
+ top:<xsl:value-of select="$y1 " />px;
+ color:<xsl:value-of select="$color" />;
+ </xsl:attribute>
+ <xsl:value-of select="@text"/>
+ </span>
+ <!-- ENF OF TEXT LINE -->
+
+ </xsl:when>
+ </xsl:choose>
- <span class="line">
- <xsl:attribute name="style">
- height:auto;
- font-size:<xsl:value-of select="$fsize" />px;
- width:<xsl:value-of select="$x2 - $x1" />px;
- left:<xsl:value-of select="$x1 " />px;
- top:<xsl:value-of select="$y1 " />px;
- color:<xsl:value-of select="$color" />;
- </xsl:attribute>
- <xsl:value-of select="@text"/>
- </span>
- <!-- ENF OF TEXT LINE -->
</xsl:template>
diff --git a/scribo/demo/xml2doc/templates/html/main_base64.xsl
b/scribo/demo/xml2doc/templates/html/main_base64.xsl
index 79941f2..6400174 100644
--- a/scribo/demo/xml2doc/templates/html/main_base64.xsl
+++ b/scribo/demo/xml2doc/templates/html/main_base64.xsl
@@ -269,19 +269,26 @@
</xsl:choose>
</xsl:variable>
+ <!-- Display lines with high enough OCR confidence -->
+ <xsl:choose>
+ <xsl:when test="@textConfidence > 60">
+
+ <span class="line">
+ <xsl:attribute name="style">
+ height:auto;
+ font-size:<xsl:value-of select="$fsize" />px;
+ width:<xsl:value-of select="$x2 - $x1" />px;
+ left:<xsl:value-of select="$x1 " />px;
+ top:<xsl:value-of select="$y1 " />px;
+ color:<xsl:value-of select="$color" />;
+ </xsl:attribute>
+ <xsl:value-of select="@text"/>
+ </span>
+ <!-- ENF OF TEXT LINE -->
+
+ </xsl:when>
+ </xsl:choose>
- <span class="line">
- <xsl:attribute name="style">
- height:auto;
- font-size:<xsl:value-of select="$fsize" />px;
- width:<xsl:value-of select="$x2 - $x1" />px;
- left:<xsl:value-of select="$x1 " />px;
- top:<xsl:value-of select="$y1 " />px;
- color:<xsl:value-of select="$color" />;
- </xsl:attribute>
- <xsl:value-of select="@text"/>
- </span>
- <!-- ENF OF TEXT LINE -->
</xsl:template>
--
1.7.2.5