Skip to content

Commit 07fb53c

Browse files
committed
Merge pull request #1260 from hotchkiss87:correct_spelling
2 parents 003097e + 574e200 commit 07fb53c

File tree

11 files changed

+65
-65
lines changed

11 files changed

+65
-65
lines changed

modules/text/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Here are instructions on how to install Tesseract on your machine (Linux or Mac;
1212
Tesseract installation instruction (Linux, Mac)
1313
-----------------------------------------------
1414

15-
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.
15+
0. Linux users may try to install tesseract-3.03-rc1 (or later) and leptonica-1.70 (or later) with the corresponding development packages using their package manager. Mac users may try brew. The instructions below are for those who wants to build tesseract from source.
1616

1717
1. download leptonica 1.70 tarball (helper image processing library, used by tesseract. Later versions might work too):
1818
http://www.leptonica.com/download.html
@@ -33,9 +33,9 @@ mkdir build && cd build
3333
../configure --with-extra-includes=/usr/local --with-extra-libraries=/usr/local
3434
make && sudo make install
3535

36-
tessract will be installed to /usr/local.
36+
Tesseract will be installed to /usr/local.
3737

38-
3. download the pre-trained classifier data for english language:
38+
3. download the pre-trained classifier data for English language:
3939
https://code.google.com/p/tesseract-ocr/downloads/detail?name=eng.traineddata.gz
4040

4141
unzip it (gzip -d eng.traineddata.gz) and copy to /usr/local/share/tessdata.

modules/text/include/opencv2/text.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ hierarchy by their inclusion relation:
6666
6767
![image](pics/component_tree.png)
6868
69-
The component tree may conatain a huge number of regions even for a very simple image as shown in
69+
The component tree may contain a huge number of regions even for a very simple image as shown in
7070
the previous image. This number can easily reach the order of 1 x 10\^6 regions for an average 1
7171
Megapixel image. In order to efficiently select suitable regions among all the ERs the algorithm
7272
make use of a sequential classifier with two differentiated stages.
7373
74-
In the first stage incrementally computable descriptors (area, perimeter, bounding box, and euler
74+
In the first stage incrementally computable descriptors (area, perimeter, bounding box, and Euler's
7575
number) are computed (in O(1)) for each region r and used as features for a classifier which
7676
estimates the class-conditional probability p(r|character). Only the ERs which correspond to local
7777
maximum of the probability p(r|character) are selected (if their probability is above a global limit

modules/text/include/opencv2/text/erfilter.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct CV_EXPORTS ERStat
7878
//! incrementally computable features
7979
int area;
8080
int perimeter;
81-
int euler; //!< euler number
81+
int euler; //!< Euler's number
8282
Rect rect;
8383
double raw_moments[2]; //!< order 1 raw moments to derive the centroid
8484
double central_moments[3]; //!< order 2 central moments to construct the covariance matrix
@@ -105,7 +105,7 @@ struct CV_EXPORTS ERStat
105105
ERStat* next;
106106
ERStat* prev;
107107

108-
//! wenever the regions is a local maxima of the probability
108+
//! whenever the regions is a local maxima of the probability
109109
bool local_maxima;
110110
ERStat* max_probability_ancestor;
111111
ERStat* min_probability_ancestor;
@@ -317,7 +317,7 @@ enum erGrouping_Modes {
317317
318318
@param channels Vector of single channel images CV_8UC1 from wich the regions were extracted.
319319
320-
@param regions Vector of ER's retreived from the ERFilter algorithm from each channel.
320+
@param regions Vector of ER's retrieved from the ERFilter algorithm from each channel.
321321
322322
@param groups The output of the algorithm is stored in this parameter as set of lists of indexes to
323323
provided regions.
@@ -353,7 +353,7 @@ CV_EXPORTS_W void erGrouping(InputArray image, InputArray channel,
353353
354354
@param image Source image CV_8UC1 from which the MSERs where extracted.
355355
356-
@param contours Intput vector with all the contours (vector\<Point\>).
356+
@param contours Input vector with all the contours (vector\<Point\>).
357357
358358
@param regions Output where the ERStat regions are stored.
359359

modules/text/include/opencv2/text/ocr.hpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class CV_EXPORTS_W OCRTesseract : public BaseOCR
153153
@param language an ISO 639-3 code or NULL will default to "eng".
154154
@param char_whitelist specifies the list of characters used for recognition. NULL defaults to
155155
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".
156-
@param oem tesseract-ocr offers different OCR Engine Modes (OEM), by deffault
156+
@param oem tesseract-ocr offers different OCR Engine Modes (OEM), by default
157157
tesseract::OEM_DEFAULT is used. See the tesseract-ocr API documentation for other possible
158158
values.
159159
@param psmode tesseract-ocr offers different Page Segmentation Modes (PSM) tesseract::PSM_AUTO
@@ -195,7 +195,7 @@ class CV_EXPORTS_W OCRHMMDecoder : public BaseOCR
195195
This way it hides the feature extractor and the classifier itself, so developers can write
196196
their own OCR code.
197197
198-
The default character classifier and feature extractor can be loaded using the utility funtion
198+
The default character classifier and feature extractor can be loaded using the utility function
199199
loadOCRHMMClassifierNM and KNN model provided in
200200
<https://github.com/opencv/opencv_contrib/blob/master/modules/text/samples/OCRHMM_knn_model_data.xml.gz>.
201201
*/
@@ -289,21 +289,21 @@ class CV_EXPORTS_W OCRHMMDecoder : public BaseOCR
289289
(<http://en.wikipedia.org/wiki/Viterbi_algorithm>).
290290
*/
291291
static Ptr<OCRHMMDecoder> create(const Ptr<OCRHMMDecoder::ClassifierCallback> classifier,// The character classifier with built in feature extractor
292-
const std::string& vocabulary, // The language vocabulary (chars when ascii english text)
292+
const std::string& vocabulary, // The language vocabulary (chars when ASCII English text)
293293
// size() must be equal to the number of classes
294294
InputArray transition_probabilities_table, // Table with transition probabilities between character pairs
295-
// cols == rows == vocabulari.size()
295+
// cols == rows == vocabulary.size()
296296
InputArray emission_probabilities_table, // Table with observation emission probabilities
297-
// cols == rows == vocabulari.size()
297+
// cols == rows == vocabulary.size()
298298
decoder_mode mode = OCR_DECODER_VITERBI); // HMM Decoding algorithm (only Viterbi for the moment)
299299

300300
CV_WRAP static Ptr<OCRHMMDecoder> create(const Ptr<OCRHMMDecoder::ClassifierCallback> classifier,// The character classifier with built in feature extractor
301-
const String& vocabulary, // The language vocabulary (chars when ascii english text)
301+
const String& vocabulary, // The language vocabulary (chars when ASCII English text)
302302
// size() must be equal to the number of classes
303303
InputArray transition_probabilities_table, // Table with transition probabilities between character pairs
304-
// cols == rows == vocabulari.size()
304+
// cols == rows == vocabulary.size()
305305
InputArray emission_probabilities_table, // Table with observation emission probabilities
306-
// cols == rows == vocabulari.size()
306+
// cols == rows == vocabulary.size()
307307
int mode = OCR_DECODER_VITERBI); // HMM Decoding algorithm (only Viterbi for the moment)
308308

309309
/** @brief Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path
@@ -312,12 +312,12 @@ class CV_EXPORTS_W OCRHMMDecoder : public BaseOCR
312312
*/
313313
CV_WRAP static Ptr<OCRHMMDecoder> create(const String& filename,
314314

315-
const String& vocabulary, // The language vocabulary (chars when ascii english text)
315+
const String& vocabulary, // The language vocabulary (chars when ASCII English text)
316316
// size() must be equal to the number of classes
317317
InputArray transition_probabilities_table, // Table with transition probabilities between character pairs
318-
// cols == rows == vocabulari.size()
318+
// cols == rows == vocabulary.size()
319319
InputArray emission_probabilities_table, // Table with observation emission probabilities
320-
// cols == rows == vocabulari.size()
320+
// cols == rows == vocabulary.size()
321321
int mode = OCR_DECODER_VITERBI, // HMM Decoding algorithm (only Viterbi for the moment)
322322

323323
int classifier = OCR_KNN_CLASSIFIER); // The character classifier type
@@ -371,7 +371,7 @@ CV_EXPORTS_W Ptr<OCRHMMDecoder::ClassifierCallback> loadOCRHMMClassifier(const S
371371

372372
/** @brief Utility function to create a tailored language model transitions table from a given list of words (lexicon).
373373
*
374-
* @param vocabulary The language vocabulary (chars when ascii english text).
374+
* @param vocabulary The language vocabulary (chars when ASCII English text).
375375
*
376376
* @param lexicon The list of words that are expected to be found in a particular image.
377377
*
@@ -466,7 +466,7 @@ class CV_EXPORTS_W OCRBeamSearchDecoder : public BaseOCR
466466
467467
@param classifier The character classifier with built in feature extractor.
468468
469-
@param vocabulary The language vocabulary (chars when ascii english text). vocabulary.size()
469+
@param vocabulary The language vocabulary (chars when ASCII English text). vocabulary.size()
470470
must be equal to the number of classes of the classifier.
471471
472472
@param transition_probabilities_table Table with transition probabilities between character
@@ -481,22 +481,22 @@ class CV_EXPORTS_W OCRBeamSearchDecoder : public BaseOCR
481481
@param beam_size Size of the beam in Beam Search algorithm.
482482
*/
483483
static Ptr<OCRBeamSearchDecoder> create(const Ptr<OCRBeamSearchDecoder::ClassifierCallback> classifier,// The character classifier with built in feature extractor
484-
const std::string& vocabulary, // The language vocabulary (chars when ascii english text)
484+
const std::string& vocabulary, // The language vocabulary (chars when ASCII English text)
485485
// size() must be equal to the number of classes
486486
InputArray transition_probabilities_table, // Table with transition probabilities between character pairs
487-
// cols == rows == vocabulari.size()
487+
// cols == rows == vocabulary.size()
488488
InputArray emission_probabilities_table, // Table with observation emission probabilities
489-
// cols == rows == vocabulari.size()
489+
// cols == rows == vocabulary.size()
490490
decoder_mode mode = OCR_DECODER_VITERBI, // HMM Decoding algorithm (only Viterbi for the moment)
491491
int beam_size = 500); // Size of the beam in Beam Search algorithm
492492

493493
CV_WRAP static Ptr<OCRBeamSearchDecoder> create(const Ptr<OCRBeamSearchDecoder::ClassifierCallback> classifier, // The character classifier with built in feature extractor
494-
const String& vocabulary, // The language vocabulary (chars when ascii english text)
494+
const String& vocabulary, // The language vocabulary (chars when ASCII English text)
495495
// size() must be equal to the number of classes
496496
InputArray transition_probabilities_table, // Table with transition probabilities between character pairs
497-
// cols == rows == vocabulari.size()
497+
// cols == rows == vocabulary.size()
498498
InputArray emission_probabilities_table, // Table with observation emission probabilities
499-
// cols == rows == vocabulari.size()
499+
// cols == rows == vocabulary.size()
500500
int mode = OCR_DECODER_VITERBI, // HMM Decoding algorithm (only Viterbi for the moment)
501501
int beam_size = 500); // Size of the beam in Beam Search algorithm
502502

@@ -506,12 +506,12 @@ class CV_EXPORTS_W OCRBeamSearchDecoder : public BaseOCR
506506
507507
*/
508508
CV_WRAP static Ptr<OCRBeamSearchDecoder> create(const String& filename, // The character classifier file
509-
const String& vocabulary, // The language vocabulary (chars when ascii english text)
509+
const String& vocabulary, // The language vocabulary (chars when ASCII English text)
510510
// size() must be equal to the number of classes
511511
InputArray transition_probabilities_table, // Table with transition probabilities between character pairs
512-
// cols == rows == vocabulari.size()
512+
// cols == rows == vocabulary.size()
513513
InputArray emission_probabilities_table, // Table with observation emission probabilities
514-
// cols == rows == vocabulari.size()
514+
// cols == rows == vocabulary.size()
515515
int mode = OCR_DECODER_VITERBI, // HMM Decoding algorithm (only Viterbi for the moment)
516516
int beam_size = 500);
517517
protected:

modules/text/samples/character_recognition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int main(int argc, char* argv[])
3737
return(0);
3838
}
3939

40-
string vocabulary = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; // must have the same order as the clasifier output classes
40+
string vocabulary = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; // must have the same order as the classifier output classes
4141

4242
Ptr<OCRHMMDecoder::ClassifierCallback> ocr = loadOCRHMMClassifierCNN("OCRBeamSearch_CNN_model_data.xml.gz");
4343

modules/text/samples/cropped_word_recognition.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int main(int argc, char* argv[])
3636
return(0);
3737
}
3838

39-
string vocabulary = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; // must have the same order as the clasifier output classes
39+
string vocabulary = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; // must have the same order as the classifier output classes
4040
vector<string> lexicon; // a list of words expected to be found on the input image
4141
lexicon.push_back(string("abb"));
4242
lexicon.push_back(string("riser"));
@@ -53,7 +53,7 @@ int main(int argc, char* argv[])
5353
createOCRHMMTransitionsTable(vocabulary,lexicon,transition_p);
5454

5555
// An alternative would be to load the default generic language model
56-
// (created from ispell 42869 english words list)
56+
// (created from ispell 42869 English words list)
5757
/*Mat transition_p;
5858
string filename = "OCRHMM_transitions_table.xml";
5959
FileStorage fs(filename, FileStorage::READ);

modules/text/samples/end_to_end_recognition.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ using namespace std;
2020
using namespace cv;
2121
using namespace cv::text;
2222

23-
//Calculate edit distance netween two words
23+
//Calculate edit distance between two words
2424
size_t edit_distance(const string& A, const string& B);
2525
size_t min(size_t x, size_t y, size_t z);
2626
bool isRepetitive(const string& s);
@@ -164,7 +164,7 @@ int main(int argc, char* argv[])
164164
cout << "TIME_OCR = " << ((double)getTickCount() - t_r)*1000/getTickFrequency() << endl;
165165

166166

167-
/* Recognition evaluation with (approximate) hungarian matching and edit distances */
167+
/* Recognition evaluation with (approximate) Hungarian matching and edit distances */
168168

169169
if(argc>2)
170170
{

modules/text/samples/segmented_word_recognition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ int main(int argc, char* argv[]) {
5454
else
5555
image.copyTo(mask);
5656

57-
// be sure the mask is a binry image
57+
// be sure the mask is a binary image
5858
cvtColor(mask, mask, COLOR_BGR2GRAY);
5959
threshold(mask, mask, 128., 255, THRESH_BINARY);
6060

modules/text/samples/webcam_demo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ int main(int argc, char* argv[])
290290
{
291291

292292
outputs[i].erase(remove(outputs[i].begin(), outputs[i].end(), '\n'), outputs[i].end());
293-
//cout << "OCR output = \"" << outputs[i] << "\" lenght = " << outputs[i].size() << endl;
293+
//cout << "OCR output = \"" << outputs[i] << "\" length = " << outputs[i].size() << endl;
294294
if (outputs[i].size() < 3)
295295
continue;
296296

0 commit comments

Comments
 (0)