How to integrate tesseract-ocr library in a catkin project?
Hi, I have no idea of how to integrate the tesseract-ocr library to my project, i use qt creator to code and the library is correctly installed since Qtcreator autocompletes the lines where i use the library but this code fails to compile
#include "text_detector.h"
#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <tesseract/baseapi.h>
image_transport::Subscriber sub;
image_transport::Publisher imPub;
ros::Publisher textPub;
tesseract::TessBaseAPI tess;
void onImageReceived(const sensor_msgs::ImageConstPtr& msg){
}
int main (int argc, char* argv[]){
ros::init(argc,argv,"text_detector");
ros::NodeHandle nh;
ROS_INFO_STREAM("Starting text detection");
image_transport::ImageTransport it(nh);
imPub = it.advertise("camera_hsv",1);
tess.Init(NULL,"eng",tesseract::OEM_DEFAULT);
sub = it.subscribe("camera_raw",1,&onImageReceived);
// textPub=nh.advertise<>("text",1000);
ros::spin();
}
with this compilation error
text_detector.cpp:-1: error: undefined reference to
tesseract::TessBaseAPI::TessBaseAPI()' text_detector.cpp:-1: error: undefined reference to
tesseract::TessBaseAPI::~TessBaseAPI()'
How can i add the library to the project in the cmakelists.txt? Thanks!
I want to execute this node for my project but i am facing some errors, can you please post me the complete node (.cpp file) and CMakeLists.text.
Hi @sirasistant! As @Kishore Kumar, I'm also interested in your findings. Are you able to share what you have right now? Thanks in advance!