Commit 1cb01d7ccc3297e973e3b29480f111e8a790dc0a
1 parent
29e81b41
Follow the advice of @caotto - make DropFrames an UntrainableMetaTransform
Showing
1 changed file
with
5 additions
and
19 deletions
openbr/plugins/frames.cpp
| ... | ... | @@ -58,35 +58,21 @@ BR_REGISTER(Transform, AggregateFrames) |
| 58 | 58 | * |
| 59 | 59 | * For a video with m frames, DropFrames will pass on m/n frames. |
| 60 | 60 | */ |
| 61 | -class DropFrames : public TimeVaryingTransform | |
| 61 | +class DropFrames : public UntrainableMetaTransform | |
| 62 | 62 | { |
| 63 | 63 | Q_OBJECT |
| 64 | 64 | Q_PROPERTY(int n READ get_n WRITE set_n RESET reset_n STORED false) |
| 65 | 65 | BR_PROPERTY(int, n, 1) |
| 66 | 66 | |
| 67 | -public: | |
| 68 | - DropFrames() : TimeVaryingTransform(false) {} | |
| 69 | - | |
| 70 | -private: | |
| 71 | - void train(const TemplateList &data) | |
| 72 | - { | |
| 73 | - (void) data; | |
| 74 | - } | |
| 75 | - | |
| 76 | - void projectUpdate(const Template &src, Template &dst) | |
| 67 | + void project(const TemplateList &src, TemplateList &dst) const | |
| 77 | 68 | { |
| 78 | - if (src.file.get<int>("FrameNumber") % n != 0) return; | |
| 69 | + if (src.first().file.get<int>("FrameNumber") % n != 0) return; | |
| 79 | 70 | dst = src; |
| 80 | 71 | } |
| 81 | 72 | |
| 82 | - void store(QDataStream &stream) const | |
| 83 | - { | |
| 84 | - (void) stream; | |
| 85 | - } | |
| 86 | - | |
| 87 | - void load(QDataStream &stream) | |
| 73 | + void project(const Template &src, Template &dst) const | |
| 88 | 74 | { |
| 89 | - (void) stream; | |
| 75 | + (void) src; (void) dst; qFatal("shouldn't be here"); | |
| 90 | 76 | } |
| 91 | 77 | }; |
| 92 | 78 | ... | ... |