Class

com.ruimo.graphics.twodim

RuledLinesRemover

Related Doc: package twodim

Permalink

class RuledLinesRemover extends AnyRef

(1) Summary Delete vertical/horizontal ruled lines in images. If correctOverlapping option is set true, overlapping of lines and charactors will be considered.

(2) Parameters deltaX: (vertical line thickness) / 2 deltaY: (horizontal line thickness) / 2 dotRatio: black dot ratio to be regarded as lines correctOverlapping: enable to correct overlapping of lines and charactors correctDelta: overlapping thickness to consider correctDotRatio: black dot ratio to be corrected or not isDebug: switch to debug mode (if set true, deleted line is drawn with green)

(3) Logic As for removal of vertical ruled lines, scan rectangles from left to right and remove them. Condition to recognize a vertical ruled line is below.

(black dots in rectangle area) >= (rectangle area) * dotRatio/100 where (rectangle area) = (deltaX) * 2 * (height of image)

After recognition of ruled line, subsequent processing is below.

(a) correctOverlapping is set false Overwrite recognized area with white color(=removed).

(b) correctOverlapping is set true Check if each dot is a part of ruled line or not. If the condition below is met, the dot is regarded as charactor and isn't removed. (black dots in areaA) >= (areaA) * correctDotRatio/100 where areaA = correctDelta * (correctDelta*2)

Example (correctDelta = 2) ■: the dot under consideration □: other dots □□□□□□□ □□□□□□□ □□□■□□□ □□□□□□□ □□□□□□□

▲: areaA □□□□□□□ □▲▲▲▲□□ □▲▲▲▲□□ □□□□□□□ □□□□□□□

Removal of horizontal ruled lines is the same as above.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RuledLinesRemover
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RuledLinesRemover(deltaX: Int = 1, deltaY: Int = 1, dotRatio: Int = 40, correctOverlapping: Boolean = true, correctDelta: Int = 2, correctDotRatio: Int = 40, isDebug: Boolean = false)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val BLACK: Int

    Permalink
  5. val BLUE: Int

    Permalink
  6. val GREEN: Int

    Permalink
  7. val RED: Int

    Permalink
  8. val WHITE: Int

    Permalink
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. var height: Int

    Permalink
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. def removeRuledLines(inputImage: BufferedImage): BufferedImage

    Permalink
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. var width: Int

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped