38 #pragma warning(push, 0) // no warnings from includes 43 #ifdef DLL_CORE_EXPORT 44 #define DllCoreExport Q_DECL_EXPORT 46 #define DllCoreExport Q_DECL_IMPORT 76 QJsonObject toJson(
const QString& filePath =
"")
const;
79 void append(
const cv::Mat& descriptor);
81 void setDescriptors(
const cv::Mat& desc);
82 cv::Mat descriptors()
const;
83 int numDescriptors()
const;
85 static QVector<FeatureCollection> split(
const cv::Mat& descriptors,
const PixelSet&
set);
86 static QString jsonKey();
104 bool isEmpty()
const;
106 void write(
const QString& filePath)
const;
111 void normalize(
int minFeaturesPerClass,
int maxFeaturesPerClass);
113 QVector<FeatureCollection> collection()
const;
115 int numFeatures()
const;
117 QString toString()
const;
118 cv::Ptr<cv::ml::TrainData> toCvTrainData(
int maxSamples = -1)
const;
124 cv::Mat allFeatures()
const;
125 cv::Mat allLabels()
const;
140 QString featureFilePath()
const;
141 QString labelConfigFilePath()
const;
142 int maxNumFeaturesPerImage()
const;
143 int minNumFeaturesPerClass()
const;
144 int maxNumFeaturesPerClass()
const;
145 QString backgroundLabelName()
const;
147 virtual QString toString()
const override;
151 void load(
const QSettings& settings)
override;
152 void save(QSettings& settings)
const override;
156 QString mBackgroundLabelName =
"";
157 int mMaxNumFeaturesPerImage = 1000000;
158 int mMinNumFeaturesPerClass = 10000;
159 int mMaxNumFeaturesPerClass = 10000;
175 bool isEmpty()
const override;
176 bool compute()
override;
177 QSharedPointer<SuperPixelLabelerConfig>
config()
const;
179 cv::Mat draw(
const cv::Mat& img,
bool drawPixels =
true)
const;
180 QString toString()
const override;
182 void setFilePath(
const QString& filePath);
183 void setRootRegion(
const QSharedPointer<RootRegion>& region);
185 void setPage(
const QSharedPointer<PageElement>& page);
186 QImage createLabelImage(
const Rect& imgRect,
bool visualize =
false)
const;
191 QVector<QSharedPointer<MserBlob> > mBlobs;
193 QSharedPointer<RootRegion> mGtRegion;
194 QSharedPointer<PageElement> mPage;
202 bool checkInput()
const override;
203 PixelSet labelBlobs(
const cv::Mat& labelImg,
const QVector<QSharedPointer<MserBlob> >& blobs)
const;
205 QString parseLabel(
const QString& filePath)
const;
207 void setBackgroundLabelName(
const QString& name);
215 QStringList featureCachePaths()
const;
216 QString modelPath()
const;
218 virtual QString toString()
const override;
220 void setNumTrees(
int numTrees);
221 int numTrees()
const;
229 void load(
const QSettings& settings)
override;
230 void save(QSettings& settings)
const override;
244 bool isEmpty()
const override;
245 bool compute()
override;
246 QSharedPointer<SuperPixelTrainerConfig>
config()
const;
248 cv::Mat draw(
const cv::Mat& img)
const;
249 QString toString()
const override;
252 bool write(
const QString& filePath)
const;
253 QSharedPointer<SuperPixelModel> model()
const;
260 cv::Ptr<cv::ml::RTrees> mModel;
262 bool checkInput()
const override;
QVector< FeatureCollection > mCollection
Definition: SuperPixelTrainer.h:122
QStringList mFeatureCachePaths
Definition: SuperPixelTrainer.h:225
QString mModelPath
Definition: SuperPixelTrainer.h:226
Definition: BaseModule.h:63
Manages FeatureCollections. Hence, each label (e.g. printed text) is stored here along with it's feat...
Definition: SuperPixelTrainer.h:99
#define DllCoreExport
Definition: BaseImageElement.h:43
PixelSet stores and manipulates pixel collections.
Definition: PixelSet.h:172
This class manages all labels loaded. It can be used to compare LabelInfo objects, and load them.
Definition: PixelLabel.h:125
FeatureCollection maps one LabelInfo to its features. In addition it handles the I/O using Json...
Definition: SuperPixelTrainer.h:70
LabelInfo mLabel
Definition: SuperPixelTrainer.h:90
QString mFeatureFilePath
Definition: SuperPixelTrainer.h:154
bool operator==(const cv::KeyPoint &kpl, const cv::KeyPoint &kpr)
Definition: ImageProcessor.cpp:45
bool merge(const QSharedPointer< TextLineSet > &tl1, const QSharedPointer< TextLineSet > &tl2)
Definition: PixelSet.cpp:1728
config
Definition: DependencyCollector.py:271
Converts GT information to label images. This class is used to assign a GT label to each SuperPixel c...
Definition: SuperPixelTrainer.h:239
cv::Mat mDesc
Definition: SuperPixelTrainer.h:89
Converts GT information to label images. This class is used to assign a GT label to each SuperPixel c...
Definition: SuperPixelTrainer.h:169
DllCoreExport bool save(const QImage &img, const QString &savePath, int compression=-1)
Saves the specified QImage img.
Definition: Image.cpp:180
Definition: SuperPixelTrainer.h:210
DllCoreExport QImage load(const QString &path, bool *ok=0)
Definition: Image.cpp:152
This is the base class for all modules. It provides all functions which are implemented by the module...
Definition: BaseModule.h:126
Definition: Algorithms.cpp:45
This class is used for mapping classes (e.g. handwriting, decoration)
Definition: PixelLabel.h:74
QString mLabelConfigFilePath
Definition: SuperPixelTrainer.h:155
This class configures the feature collection process. It controls I/O paths for feature labels and fe...
Definition: SuperPixelTrainer.h:135