44
#ifndef __OPENCV_TEXT_ERFILTER_HPP__
45
#define __OPENCV_TEXT_ERFILTER_HPP__
47
#include "opencv2/core.hpp"
70
explicit
ERStat(
int
level = 256,
int
pixel = 0,
int
x = 0,
int
y = 0);
83
double
raw_moments[2];
84
double
central_moments[3];
90
float
convex_hull_ratio;
91
float
num_inflexion_points;
97
std::vector<int> *pixels;
110
ERStat* max_probability_ancestor;
111
ERStat* min_probability_ancestor;
151
virtual
void
run( InputArray image, std::vector<ERStat>& regions ) = 0;
156
virtual
void
setThresholdDelta(
int
thresholdDelta) = 0;
157
virtual
void
setMinArea(
float
minArea) = 0;
158
virtual
void
setMaxArea(
float
maxArea) = 0;
159
virtual
void
setMinProbability(
float
minProbability) = 0;
160
virtual
void
setMinProbabilityDiff(
float
minProbabilityDiff) = 0;
161
virtual
void
setNonMaxSuppression(
bool
nonMaxSuppression) = 0;
162
virtual
int
getNumRejected()
const
= 0;
188
int
thresholdDelta = 1,
float
minArea = (
float)0.00025,
189
float
maxArea = (
float)0.13,
float
minProbability = (
float)0.4,
190
bool
nonMaxSuppression =
true,
191
float
minProbabilityDiff = (
float)0.1);
205
float
minProbability = (
float)0.3);
213
int
thresholdDelta = 1,
float
minArea = (
float)0.00025,
214
float
maxArea = (
float)0.13,
float
minProbability = (
float)0.4,
215
bool
nonMaxSuppression =
true,
216
float
minProbabilityDiff = (
float)0.1);
224
float
minProbability = (
float)0.3);
244
enum
{ ERFILTER_NM_RGBLGrad,
316
CV_EXPORTS
void
erGrouping(InputArray img, InputArrayOfArrays channels,
317
std::vector<std::vector<ERStat> > ®ions,
318
std::vector<std::vector<Vec2i> > &groups,
319
std::vector<Rect> &groups_rects,
321
const
std::string& filename = std::string(),
322
float
minProbablity = 0.5);
324CV_EXPORTS_W
void
erGrouping(InputArray image, InputArray channel,
325
std::vector<std::vector<Point> > regions,
326
CV_OUT std::vector<Rect> &groups_rects,
328
const
String& filename = String(),
329
float
minProbablity = (
float)0.5);
347
CV_EXPORTS
void
MSERsToERStats(InputArray image, std::vector<std::vector<Point> > &contours,
348
std::vector<std::vector<ERStat> > ®ions);
368
const
String& filename = String(),
369
float
minProbability = (
float)0.5);
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition:
mat.hpp:295
This is a base class for all more or less complex algorithms in OpenCV
Definition:
core.hpp:3091
Template class for 2D rectangles
Definition:
core/types.hpp:421
Callback with the classifier is made a class.
Definition:
erfilter.hpp:128
virtual double eval(const ERStat &stat)=0
The classifier must return probability measure for the region.
Base class for 1st and 2nd stages of Neumann and Matas scene text detection algorithm ....
Definition:
erfilter.hpp:119
virtual void run(InputArray image, std::vector< ERStat > ®ions)=0
The key method of ERFilter algorithm.
virtual void setCallback(const Ptr< ERFilter::Callback > &cb)=0
set/get methods to set the algorithm properties,
CV_EXPORTS_W Ptr< ERFilter::Callback > loadClassifierNM2(const String &filename)
Allow to implicitly load the default classifier when creating an ERFilter object.
CV_EXPORTS void MSERsToERStats(InputArray image, std::vector< std::vector< Point > > &contours, std::vector< std::vector< ERStat > > ®ions)
Converts MSER contours (vector<Point>) to ERStat regions.
CV_EXPORTS_W void computeNMChannels(InputArray _src, CV_OUT OutputArrayOfArrays _channels, int _mode=ERFILTER_NM_RGBLGrad)
Compute the different channels to be processed independently in the N&M algorithm .
CV_EXPORTS_W void detectRegions(InputArray image, const Ptr< ERFilter > &er_filter1, const Ptr< ERFilter > &er_filter2, CV_OUT std::vector< Rect > &groups_rects, int method=ERGROUPING_ORIENTATION_HORIZ, const String &filename=String(), float minProbability=(float) 0.5)
Extracts text regions from image.
CV_EXPORTS_W Ptr< ERFilter > createERFilterNM1(const String &filename, int thresholdDelta=1, float minArea=(float) 0.00025, float maxArea=(float) 0.13, float minProbability=(float) 0.4, bool nonMaxSuppression=true, float minProbabilityDiff=(float) 0.1)
Reads an Extremal Region Filter for the 1st stage classifier of N&M algorithm from the provided path ...
CV_EXPORTS void erGrouping(InputArray img, InputArrayOfArrays channels, std::vector< std::vector< ERStat > > ®ions, std::vector< std::vector< Vec2i > > &groups, std::vector< Rect > &groups_rects, int method=ERGROUPING_ORIENTATION_HORIZ, const std::string &filename=std::string(), float minProbablity=0.5)
Find groups of Extremal Regions that are organized as text blocks.
CV_EXPORTS_W Ptr< ERFilter > createERFilterNM2(const String &filename, float minProbability=(float) 0.3)
Reads an Extremal Region Filter for the 2nd stage classifier of N&M algorithm from the provided path ...
erGrouping_Modes
text::erGrouping operation modes
Definition:
erfilter.hpp:267
CV_EXPORTS_W Ptr< ERFilter::Callback > loadClassifierNM1(const String &filename)
Allow to implicitly load the default classifier when creating an ERFilter object.
@ ERGROUPING_ORIENTATION_HORIZ
Definition:
erfilter.hpp:279
@ ERGROUPING_ORIENTATION_ANY
Definition:
erfilter.hpp:290
"black box" representation of the file storage associated with a file on disk.
Definition:
aruco.hpp:75
Definition:
cvstd_wrapper.hpp:74
The ERStat structure represents a class-specific Extremal Region (ER).
Definition:
erfilter.hpp:67
float hole_area_ratio
2nd stage features
Definition:
erfilter.hpp:89
bool local_maxima
whenever the regions is a local maxima of the probability
Definition:
erfilter.hpp:109
int area
incrementally computable features
Definition:
erfilter.hpp:79
ERStat(int level=256, int pixel=0, int x=0, int y=0)
Constructor
Ptr< std::deque< int > > crossings
horizontal crossings
Definition:
erfilter.hpp:85
float med_crossings
median of the crossings at three different height levels
Definition:
erfilter.hpp:86
double probability
probability that the ER belongs to the class we are looking for
Definition:
erfilter.hpp:100
ERStat * parent
pointers preserving the tree structure of the component tree
Definition:
erfilter.hpp:103
int euler
Euler's number
Definition:
erfilter.hpp:81
int pixel
seed point and the threshold (max grey-level value)
Definition:
erfilter.hpp:75
~ERStat()
Destructor
Definition:
erfilter.hpp:72