Commit cf3dff2e authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed several warnings in opencv_contrib (text, xfeatures2d); added tesseract…

fixed several warnings in opencv_contrib (text, xfeatures2d); added tesseract installation mini-guide in text/readme.md
parent e76ca3ee
Scene Text Detection and Recognition in Natural Scene Images
============================================================
The module contains algorithms to detect text, segment words and recognise the text.
It's mainly intended for the "text in the wild", i.e. short phrases and separate words that occur on navigation signs and such. It's not an OCR tool for scanned documents, do not treat it as such.
The detection part can in theory handle different languages, but will likely fail on hieroglyphic texts.
The recognition part currently uses open-source Tesseract OCR (https://code.google.com/p/tesseract-ocr/). If Tesseract OCR is not installed on your system, the corresponding part of the functionality will be unavailable.
Here are instructions on how to install Tesseract on your machine (Linux or Mac; Windows users should look for precompiled binaries or try to adopt the instructions below):
Tesseract installation instruction (Linux, Mac)
-----------------------------------------------
0. Linux users may try to install tesseract-3.03-rc1 (or later) and leptonica-1.70 (or later) with the corresponding developement packages using their package manager. Mac users may try brew. The instructions below are for those who wants to build tesseract from source.
1. download leptonica 1.70 tarball (helper image processing library, used by tesseract. Later versions might work too):
http://www.leptonica.com/download.html
unpack and build it:
cd leptonica-1.70
mkdir build && cd build && ../configure && make && sudo make install
leptonica will be installed to /usr/local.
2. download tesseract-3.03-rc1 tarball from https://drive.google.com/folderview?id=0B7l10Bj_LprhQnpSRkpGMGV2eE0&usp=sharing
unpack and build it:
# needed only to build tesseract
export LIBLEPT_HEADERSDIR=/usr/local/include/
cd tesseract-3.03
mkdir build && cd build
../configure --with-extra-includes=/usr/local --with-extra-libraries=/usr/local
make && sudo make install
tessract will be installed to /usr/local.
3. download the pre-trained classifier data for english language:
https://code.google.com/p/tesseract-ocr/downloads/detail?name=eng.traineddata.gz
unzip it (gzip -d eng.traineddata.gz) and copy to /usr/local/share/tessdata.
Notes
-----
1. Google announced that they close code.google.com, so at some moment in the future you may have to find Tesseract 3.03rc1 or later.
2. Tesseract configure script may fail to detect leptonica, so you may have to edit the configure script - comment off some if's around this message and retain only "then" branch.
3. You are encouraged to search the Net for some better pre-trained classifiers, as well as classifiers for other languages.
......@@ -1701,7 +1701,7 @@ public:
}
};
#if 0
/* Functions for the update of the dissimilarity array */
inline static void f_single( double * const b, const double a )
......@@ -1844,7 +1844,7 @@ static void NN_chain_core(const int_fast32_t N, double * const D, t_members * co
}
}
}
#endif
/*
Clustering methods for vector data
......
......@@ -205,6 +205,10 @@ public:
*/
virtual void compute( InputArray image, std::vector<KeyPoint>& keypoints, OutputArray descriptors ) = 0;
virtual void compute( InputArrayOfArrays images,
std::vector<std::vector<KeyPoint> >& keypoints,
OutputArrayOfArrays descriptors );
/** @overload
* @param image image to extract descriptors
* @param roi region of interest within image
......
......@@ -61,7 +61,7 @@ namespace xfeatures2d
// constants
const double g_sigma_0 = 1;
const double g_sigma_1 = sqrt(2.0);
const double g_sigma_2 = 8;
//const double g_sigma_2 = 8;
const double g_sigma_step = std::pow(2,1.0/2);
const int g_scale_st = int( (log(g_sigma_1/g_sigma_0)) / log(g_sigma_step) );
static int g_scale_en = 1;
......@@ -74,6 +74,13 @@ static const int MAX_NORMALIZATION_ITER = 5;
int g_selected_cubes[MAX_CUBE_NO]; // m_rad_q_no < MAX_CUBE_NO
void DAISY::compute( InputArrayOfArrays images,
std::vector<std::vector<KeyPoint> >& keypoints,
OutputArrayOfArrays descriptors )
{
DescriptorExtractor::compute(images, keypoints, descriptors);
}
/*
!DAISY implementation
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment