Created
November 26, 2015 08:03
-
-
Save MarcWang/0fd67e43bebec15e4232 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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