Skip to content

Instantly share code, notes, and snippets.

@MarcWang
Created November 26, 2015 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcWang/0fd67e43bebec15e4232 to your computer and use it in GitHub Desktop.
Save MarcWang/0fd67e43bebec15e4232 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <TEXTRecognizer.h>
void main()
{
TEXTRecognizer textHandler;
// std::vector<std::string> lexicon;
// lexicon.push_back(std::string("CHINA"));
// textHandler.initialize( lexicon );
textHandler.initialize();
cv::Mat charMat = cv::imread("scenetext_char01.jpg");
std::string str;
double confidence;
textHandler.charDecode( charMat, str, confidence);
std::cout << "Character = " << str << ", Confidence = " << confidence << std::endl;
cv::Mat txtMat = cv::imread("scenetext_word01.jpg");
std::string output;
float confidences;
textHandler.textDecode( txtMat, output, confidences);
std::cout << "Text = "<< output <<", Confidence = "<<confidences<< std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment