123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- #ifndef FRAME_H
- #define FRAME_H
- #include <QString>
- #include <QPolygon>
- #include "object.h"
- #include "mask.h"
- #include "frametree.h"
- #include "opencv2/opencv.hpp"
- class Kamera;
- class Frame : public FrameTreeNode
- {
- private:
- QString path;
- QList<ObjectPolygon> objects;
- QString timestamp;
- QSize size;
- bool needAnnotation;
- bool needSave;
- public:
-
-
-
-
-
-
- Frame(QString imgPath,
- QString timestamp,
- int index,
- Kamera *kam,
- bool needAnnotation);
- ~Frame();
-
- void setNeedSave();
-
- void* getNodeObject() const override;
-
- int getChildCount() const override;
-
-
- void removeSelectedVertices(QRect area);
-
-
- void removeObject(ObjectPolygon o);
-
-
-
-
-
- void addObject(QString name,
- bool truncated,
- QList<QPolygon>po);
-
-
-
- void applyMask(Mask& m);
-
-
-
-
-
- void splitObject(ObjectPolygon object,
- int begin,
- int end,
- int pIndex);
-
- QString getName() const;
-
- QString getTimestamp() const;
-
- QList<ObjectPolygon>& getObjects();
-
-
-
- void setObjects(std::vector<std::vector<cv::Point> >objects);
-
- QImage getImage();
-
- cv::Mat getImageMatrix() const;
-
-
- QImage getObjectImage(QString objectId);
-
-
- QImage getObjectImage(ObjectPolygon object);
-
-
- bool hasObject(QString id);
-
-
- bool isCorrectAnnotated() const;
-
- bool isNotAnnotated() const;
-
-
-
-
-
- ObjectPolygon getObjectAt(QPoint pos,
- int & pIndex) const;
-
-
-
-
-
-
-
- void setObjectAt(QPoint pos,
- ObjectPolygon object,
- QPoint center = QPoint(0, 0),
- float rotation = 0);
-
-
- void selectObjectAt(QPoint pos);
-
-
- QPolygon clipPolygon(QPolygon uncliped) const;
-
-
- void connectObjects(QString id);
-
-
- void disconnectObject( ObjectPolygon o );
-
-
- bool wasChangedSinceLastSave();
- };
- #endif
|