com
.
johnsnowlabs
.
nlp
.
util
.
io
OcrHelper
Related Doc:
package io
class
OcrHelper
extends
ImageProcessing
with
Serializable
Linear Supertypes
Serializable
,
ImageProcessing
,
AnyRef
,
Any
Ordering
Alphabetic
By Inheritance
Inherited
OcrHelper
Serializable
ImageProcessing
AnyRef
Any
Hide All
Show All
Visibility
Public
All
Instance Constructors
new
OcrHelper
()
Value Members
final
def
!=
(
arg0:
Any
)
:
Boolean
Definition Classes
AnyRef → Any
final
def
##
()
:
Int
Definition Classes
AnyRef → Any
final
def
==
(
arg0:
Any
)
:
Boolean
Definition Classes
AnyRef → Any
final
def
asInstanceOf
[
T0
]
:
T0
Definition Classes
Any
def
binarize
(
bi:
BufferedImage
)
:
BufferedImage
def
clone
()
:
AnyRef
Attributes
protected[
java.lang
]
Definition Classes
AnyRef
Annotations
@throws
(
...
)
def
convertToGrayScale
(
img:
BufferedImage
)
:
BufferedImage
Attributes
protected
Definition Classes
ImageProcessing
def
correctSkew
(
image:
BufferedImage
,
angle:
Double
,
resolution:
Double
)
:
BufferedImage
Attributes
protected
Definition Classes
ImageProcessing
def
createDataset
(
spark:
SparkSession
,
inputPath:
String
)
:
Dataset
[
OcrRow
]
def
createMap
(
inputPath:
String
)
:
Map
[
String
,
String
]
def
drawRectanglesDataset
(
spark:
SparkSession
,
dataset:
Dataset
[_]
,
filenameCol:
String
=
"filename"
,
pagenumCol:
String
=
"pagenum"
,
coordinatesCol:
String
=
"coordinates"
,
outputLocation:
String
=
"./highlighted/"
,
outputSuffix:
String
=
"_draw"
)
:
Unit
def
drawRectanglesToFile
(
inputPath:
String
,
coordinates:
List
[
Coordinate
]
,
outputPath:
String
)
:
Unit
def
drawRectanglesToFile
(
inputPath:
String
,
coordinates:
Seq
[
Coordinate
]
,
outputPath:
String
)
:
Unit
def
dumpImage
(
bi:
BufferedImage
,
filename:
String
)
:
Boolean
Attributes
protected
Definition Classes
ImageProcessing
final
def
eq
(
arg0:
AnyRef
)
:
Boolean
Definition Classes
AnyRef
def
equals
(
arg0:
Any
)
:
Boolean
Definition Classes
AnyRef → Any
def
erode
(
bi:
BufferedImage
,
kernelSize:
Int
)
:
BufferedImage
def
finalize
()
:
Unit
Attributes
protected[
java.lang
]
Definition Classes
AnyRef
Annotations
@throws
(
classOf[java.lang.Throwable]
)
def
fromSigned
(
integer:
Int
)
:
Byte
def
fromUnsigned
(
byte:
Byte
)
:
Int
final
def
getClass
()
:
Class
[_]
Definition Classes
AnyRef → Any
def
getEngineMode
:
Int
def
getFallbackMethod
:
Boolean
def
getIncludeConfidence
:
Boolean
def
getMinSizeBeforeFallback
:
Int
def
getPageIteratorLevel
:
Int
def
getPageSegMode
:
Int
def
getPreferredMethod
:
String
def
getSplitPages
:
Boolean
def
getSplitRegions
:
Boolean
def
hashCode
()
:
Int
Definition Classes
AnyRef → Any
final
def
isInstanceOf
[
T0
]
:
Boolean
Definition Classes
Any
final
def
ne
(
arg0:
AnyRef
)
:
Boolean
Definition Classes
AnyRef
final
def
notify
()
:
Unit
Definition Classes
AnyRef
final
def
notifyAll
()
:
Unit
Definition Classes
AnyRef
def
reScaleImage
(
image:
PlanarImage
,
factor:
Float
)
:
BufferedImage
var
scalingFactor
:
Option
[
Float
]
def
setAutomaticSkewCorrection
(
useIt:
Boolean
,
halfAngle:
Double
=
5.0
,
resolution:
Double
=
1.0
)
:
Unit
def
setEngineMode
(
mode:
Int
)
:
Unit
def
setEstimateNoise
(
noiseMethod:
String
)
:
Unit
def
setFallbackMethod
(
value:
Boolean
)
:
Unit
def
setIncludeConfidence
(
value:
Boolean
)
:
Unit
def
setMinSizeBeforeFallback
(
value:
Int
)
:
Unit
def
setPageIteratorLevel
(
level:
Int
)
:
Unit
def
setPageSegMode
(
mode:
Int
)
:
Unit
def
setPreferredMethod
(
value:
String
)
:
Unit
def
setScalingFactor
(
factor:
Float
)
:
Unit
def
setSplitPages
(
value:
Boolean
)
:
Unit
def
setSplitRegions
(
value:
Boolean
)
:
Unit
def
signedByte2UnsignedInt
(
byte:
Byte
)
:
Int
Definition Classes
ImageProcessing
def
stdev
(
histogram:
Array
[
Int
]
)
:
Double
final
def
synchronized
[
T0
]
(
arg0: ⇒
T0
)
:
T0
Definition Classes
AnyRef
def
thresholdAndInvert
(
bi:
BufferedImage
,
threshold:
Int
,
maxVal:
Int
)
:
BufferedImage
Attributes
protected
Definition Classes
ImageProcessing
def
toBufferedImage
(
img:
Image
)
:
BufferedImage
Attributes
protected
Definition Classes
ImageProcessing
def
toString
()
:
String
Definition Classes
AnyRef → Any
def
unsignedInt2signedByte
(
inte:
Int
)
:
Byte
Definition Classes
ImageProcessing
def
useErosion
(
useIt:
Boolean
,
kSize:
Int
=
2
,
kernelShape:
Int
=
Kernels.SQUARED
)
:
Unit
final
def
wait
()
:
Unit
Definition Classes
AnyRef
Annotations
@throws
(
...
)
final
def
wait
(
arg0:
Long
,
arg1:
Int
)
:
Unit
Definition Classes
AnyRef
Annotations
@throws
(
...
)
final
def
wait
(
arg0:
Long
)
:
Unit
Definition Classes
AnyRef
Annotations
@throws
(
...
)
Inherited from
Serializable
Inherited from
ImageProcessing
Inherited from
AnyRef
Inherited from
Any
Ungrouped