38 #pragma warning (disable: 4251) // inlined Qt functions in dll interface 40 #pragma warning(push, 0) // no warnings from includes 42 #include <QStringList> 47 #ifdef DLL_CORE_EXPORT 48 #define DllCoreExport Q_DECL_EXPORT 50 #define DllCoreExport Q_DECL_IMPORT 84 LabelInfo(
int id = label_unknown,
const QString& mName = QString());
91 bool contains(
const QString& key)
const;
96 QColor visColor()
const;
97 bool isBackground()
const;
99 QString toString()
const;
101 static LabelInfo fromString(
const QString& str);
103 void toJson(QJsonObject& jo)
const;
104 static LabelInfo fromJson(
const QJsonObject& jo);
105 static QString jsonKey();
106 static int color2Id(
const QColor& col);
113 int mId = label_unknown;
114 bool mIsBackground =
false;
115 QString mName =
"unknown";
130 bool isEmpty()
const;
134 void toJson(QJsonObject& jo)
const;
137 bool contains(
const LabelInfo& label)
const;
138 bool containsId(
const LabelInfo& label)
const;
140 QString toString()
const;
145 int indexOf(
int id)
const;
148 QVector<LabelInfo> labelInfos()
const;
150 static QString jsonKey();
152 void draw(QPainter& p)
const;
163 bool isEmpty()
const;
165 void setRawVotes(
const cv::Mat& rawVotes);
166 cv::Mat data()
const;
168 int labelIndex()
const;
173 double mNumTrees = 0;
183 bool isEvaluated()
const;
188 void setTrueLabel(
const LabelInfo& label);
205 bool isEmpty()
const;
207 cv::Ptr<cv::ml::StatModel> model()
const;
208 cv::Ptr<cv::ml::RTrees> randomTrees()
const;
211 QVector<PixelLabel> classify(
const cv::Mat& features)
const;
213 bool write(
const QString& filePath)
const;
214 static QSharedPointer<SuperPixelModel> read(
const QString& filePath);
220 static cv::Ptr<cv::ml::RTrees> readRTreesModel(QJsonObject& jo);
221 void toJson(QJsonObject& jo)
const;
QVector< LabelInfo > mLookups
Definition: PixelLabel.h:155
PixelVotes mVotes
Definition: PixelLabel.h:197
#define DllCoreExport
Definition: BaseImageElement.h:43
Definition: PixelLabel.h:158
QDataStream & operator<<(QDataStream &s, const BaseElement &e)
Definition: BaseImageElement.cpp:81
This class manages all labels loaded. It can be used to compare LabelInfo objects, and load them.
Definition: PixelLabel.h:125
LabelManager mManager
Definition: PixelLabel.h:218
bool operator==(const cv::KeyPoint &kpl, const cv::KeyPoint &kpr)
Definition: ImageProcessor.cpp:45
Definition: PixelLabel.h:200
Definition: BaseImageElement.h:53
LabelManager mManager
Definition: PixelLabel.h:171
DllCoreExport QColor darkGray(double alpha=1.0)
Returns a dark gray.
Definition: Drawer.cpp:146
cv::Mat mVotes
Definition: PixelLabel.h:172
Definition: Elements.h:65
DefaultLabels
Definition: PixelLabel.h:78
Definition: Algorithms.cpp:45
Definition: PixelLabel.h:178
This class is used for mapping classes (e.g. handwriting, decoration)
Definition: PixelLabel.h:74
bool operator!=(const BaseElement &l, const BaseElement &r)
Returns true if l and r do not have the same id.
Definition: BaseImageElement.cpp:77
QSharedPointer< TextLineSet > find(const QString &id, const QVector< QSharedPointer< TextLineSet > > &tl)
cv::Ptr< cv::ml::StatModel > mModel
Definition: PixelLabel.h:217
QStringList mAlias
Definition: PixelLabel.h:116