| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 | /*By downloading, copying, installing or using the software you agree to thislicense. If you do not agree to this license, do not download, install,copy or use the software.                          License Agreement               For Open Source Computer Vision Library                       (3-clause BSD License)Copyright (C) 2013, OpenCV Foundation, all rights reserved.Third party copyrights are property of their respective owners.Redistribution and use in source and binary forms, with or without modification,are permitted provided that the following conditions are met:  * Redistributions of source code must retain the above copyright notice,    this list of conditions and the following disclaimer.  * Redistributions in binary form must reproduce the above copyright notice,    this list of conditions and the following disclaimer in the documentation    and/or other materials provided with the distribution.  * Neither the names of the copyright holders nor the names of the contributors    may be used to endorse or promote products derived from this software    without specific prior written permission.This software is provided by the copyright holders and contributors "as is" andany express or implied warranties, including, but not limited to, the impliedwarranties of merchantability and fitness for a particular purpose aredisclaimed. In no event shall copyright holders or contributors be liable forany direct, indirect, incidental, special, exemplary, or consequential damages(including, but not limited to, procurement of substitute goods or services;loss of use, data, or profits; or business interruption) however causedand on any theory of liability, whether in contract, strict liability,or tort (including negligence or otherwise) arising in any way out ofthe use of this software, even if advised of the possibility of such damage.*/#ifndef __OPENCV_TEXT_HPP__#define __OPENCV_TEXT_HPP__#include "opencv2/text/erfilter.hpp"#include "opencv2/text/ocr.hpp"/** @defgroup text Scene Text Detection and RecognitionThe opencv_text module provides different algorithms for text detection and recognition in naturalscene images.  @{    @defgroup text_detect Scene Text DetectionClass-specific Extremal Regions for Scene Text Detection--------------------------------------------------------The scene text detection algorithm described below has been initially proposed by Lukás Neumann &Jiri Matas @cite Neumann11. The main idea behind Class-specific Extremal Regions is similar to the MSERin that suitable Extremal Regions (ERs) are selected from the whole component tree of the image.However, this technique differs from MSER in that selection of suitable ERs is done by a sequentialclassifier trained for character detection, i.e. dropping the stability requirement of MSERs andselecting class-specific (not necessarily stable) regions.The component tree of an image is constructed by thresholding by an increasing value step-by-stepfrom 0 to 255 and then linking the obtained connected components from successive levels in ahierarchy by their inclusion relation:The component tree may contain a huge number of regions even for a very simple image as shown inthe previous image. This number can easily reach the order of 1 x 10\^6 regions for an average 1Megapixel image. In order to efficiently select suitable regions among all the ERs the algorithmmake use of a sequential classifier with two differentiated stages.In the first stage incrementally computable descriptors (area, perimeter, bounding box, and Euler'snumber) are computed (in O(1)) for each region r and used as features for a classifier whichestimates the class-conditional probability p(r|character). Only the ERs which correspond to localmaximum of the probability p(r|character) are selected (if their probability is above a global limitp_min and the difference between local maximum and local minimum is greater than a delta_minvalue).In the second stage, the ERs that passed the first stage are classified into character andnon-character classes using more informative but also more computationally expensive features. (Holearea ratio, convex hull ratio, and the number of outer boundary inflexion points).This ER filtering process is done in different single-channel projections of the input image inorder to increase the character localization recall.After the ER filtering is done on each input channel, character candidates must be grouped inhigh-level text blocks (i.e. words, text lines, paragraphs, ...). The opencv_text module implementstwo different grouping algorithms: the Exhaustive Search algorithm proposed in @cite Neumann12 forgrouping horizontally aligned text, and the method proposed by Lluis Gomez and Dimosthenis Karatzasin @cite Gomez13 @cite Gomez14 for grouping arbitrary oriented text (see erGrouping).To see the text detector at work, have a look at the textdetection demo:<https://github.com/opencv/opencv_contrib/blob/master/modules/text/samples/textdetection.cpp>    @defgroup text_recognize Scene Text Recognition  @}*/#endif
 |