Git Product home page Git Product logo

kanjitomo-ocr's Introduction

kanjitomo-ocr

Introduction

KanjiTomo OCR is a Java library for identifying Japanese characters from images. The algorithm used in this library is custom made, originally used with KanjiTomo program: https://www.kanjitomo.net/ Description of the algorithm is here.

This library is intented to be used with interactive programs where user can point to individual words with a mouse. Batch-processing whole pages is not supported.

Installation

  • Include KanjiTomoOCR.jar to your project
  • Add "--illegal-access=deny" JVM parameter, this is not strictly required but prevents unnecessary warnings on startup
  • "-Xmx1200m" and "-server" JVM parameters are also recommended for performance reasons

Usage

  • Create KanjiTomo class instance
  • Load data structures with loadData method. This needs to be done only at startup.
  • Set the target image with setTargetImage method. This can be whole page or screenshot around target word. Screenshots around mouse cursor can be taken with Java's Robot class.
  • Start OCR with runOCR method. Point argument determines the first character to be scanned in target image's coordinates and should correspond to mouse cursor location.
  • Results are returned as OCRResults object. bestMatchingCharacters field contains a list of identified characters and words list contains results of a dictionary search from these characters.

Example

KanjiTomo tomo = new KanjiTomo();
tomo.loadData();
BufferedImage image = ImageIO.read(new File("file.png"));
tomo.setTargetImage(image);
OCRResults results = tomo.runOCR(new Point(80,40));
System.out.println(results);

License

KanjiTomo is free to use for non-commercial purposes. License file is here

Credits

KanjiTomo has been created by Sakari Kääriäinen. You can contact me at kanjitomo(at)gmail.com

Acknowledgements

EDICT, ENAMDICT and KANJIDIC dictionaries are the property of the Electronic Dictionary Research and Development Group, and are used in conformance with the Group's licence.
https://www.edrdg.org/jmdict/edict.html

imgscalr library by Riyad Kalla
https://github.com/rkalla/imgscalr

Unsharp Mask code by Romain Guy
http://www.java2s.com/Code/Java/Advanced-Graphics/UnsharpMaskDemo.htm

Kryo library by EsotericSoftware
https://github.com/EsotericSoftware/kryo

kanjitomo-ocr's People

Contributors

sakarika avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.