Commit 3bccd4be671230e39d610865a1d713e46f1d875e
Merge branch 'master' of https://github.com/biometrics/openbr
Showing
5 changed files
with
8 additions
and
6 deletions
openbr/plugins/algorithms.cpp
| ... | ... | @@ -52,7 +52,7 @@ class AlgorithmsInitializer : public Initializer |
| 52 | 52 | |
| 53 | 53 | Globals->abbreviations.insert("HOG", "Stream(DropFrames(5)+Cvt(Gray)+KeyPointDetector(SIFT)+ROI+Expand+Resize(32,32)+Gradient+RectRegions+Bin(0,360,8)+Hist(8)+Cat)+Contract+CatRows+KMeans(500)+Hist(500)+SVM"); |
| 54 | 54 | Globals->abbreviations.insert("HOF", "Stream(DropFrames(5)+KeyPointDetector(SIFT)+AggregateFrames(2)+OpticalFlow+ROI+Expand+Resize(32,32)+Gradient+RectRegions+Bin(0,360,8)+Hist(8)+Cat)+Contract+CatRows+KMeans(500)+Hist(500)"); |
| 55 | - Globals->abbreviations.insert("HOGHOF", "Stream(DropFrames(5)+Cvt(Gray),KeyPointDetector(SIFT)+AggregateFrames(2)+(OpticalFlow+Gradient+Bin(0,360,8)+ROI+Hist(8))/(First+Gradient+Bin(0,360,8)+ROI+Hist(8))+CatCols)+Contract+CatRows+KMeans(500)+Hist(500)"); | |
| 55 | + Globals->abbreviations.insert("HOGHOF", "Stream(DropFrames(5)+KeyPointDetector(SIFT)+AggregateFrames(2)+(OpticalFlow++ROI+Expand+Resize(32,32)+Gradient+RectRegions+Bin(0,360,8)+Hist(8)+Cat+Contract)/(First+Cvt(Gray)+ROI+Expand+Resize(32,32)+Gradient+RectRegions+Bin(0,360,8)+Hist(8)+Cat+Contract)+CatCols)+Contract+CatRows+KMeans(500)+Hist(500)+SVM"); | |
| 56 | 56 | |
| 57 | 57 | // Generic Image Processing |
| 58 | 58 | Globals->abbreviations.insert("SIFT", "Open+KeyPointDetector(SIFT)+KeyPointDescriptor(SIFT):KeyPointMatcher(BruteForce)"); | ... | ... |
openbr/plugins/frames.cpp
| ... | ... | @@ -27,12 +27,14 @@ private: |
| 27 | 27 | (void) data; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - void projectUpdate(const Template &src, Template &dst) | |
| 30 | + void projectUpdate(const TemplateList &src, TemplateList &dst) | |
| 31 | 31 | { |
| 32 | 32 | buffer.append(src); |
| 33 | 33 | if (buffer.size() < n) return; |
| 34 | - foreach (const Template &t, buffer) dst.append(t); | |
| 35 | - dst.file = buffer.takeFirst().file; | |
| 34 | + Template out; | |
| 35 | + foreach (const Template &t, buffer) out.append(t); | |
| 36 | + out.file = buffer.takeFirst().file; | |
| 37 | + dst.append(out); | |
| 36 | 38 | } |
| 37 | 39 | |
| 38 | 40 | void finalize(TemplateList & output) | ... | ... |
openbr/plugins/meta.cpp
| ... | ... | @@ -265,6 +265,7 @@ class ContractTransform : public UntrainableMetaTransform |
| 265 | 265 | virtual void project(const TemplateList &src, TemplateList &dst) const |
| 266 | 266 | { |
| 267 | 267 | //dst = Expanded(src); |
| 268 | + if (src.empty()) return; | |
| 268 | 269 | Template out; |
| 269 | 270 | |
| 270 | 271 | foreach (const Template & t, src) { | ... | ... |
openbr/plugins/opticalflow.cpp
| ... | ... | @@ -34,7 +34,7 @@ class OpticalFlowTransform : public UntrainableMetaTransform |
| 34 | 34 | void project(const Template &src, Template &dst) const |
| 35 | 35 | { |
| 36 | 36 | // get the two images put there by AggregateFrames |
| 37 | - if (src.size() < 2) return; | |
| 37 | + if (src.size() != 2) qFatal("Optical Flow requires two images."); | |
| 38 | 38 | Mat prevImg = src[0], nextImg = src[1], flow, flowOneCh; |
| 39 | 39 | if (src[0].channels() != 1) OpenCVUtils::cvtGray(src[0], prevImg); |
| 40 | 40 | if (src[1].channels() != 1) OpenCVUtils::cvtGray(src[1], nextImg); | ... | ... |
openbr/plugins/regions.cpp
| ... | ... | @@ -141,7 +141,6 @@ class CatColsTransform : public UntrainableMetaTransform |
| 141 | 141 | |
| 142 | 142 | void project(const Template &src, Template &dst) const |
| 143 | 143 | { |
| 144 | - if (src.empty()) return; | |
| 145 | 144 | dst.file = src.file; |
| 146 | 145 | Mat m = OpenCVUtils::toMatByRow(src); |
| 147 | 146 | // right now this just splits src in half and joins them horizontally | ... | ... |