Commit 2627418b4ca9b3c4962e1578508fda5fc18ea141
Merge branch 'master' of https://github.com/biometrics/openbr
Showing
3 changed files
with
33 additions
and
6 deletions
openbr/plugins/gui.cpp
| ... | ... | @@ -510,6 +510,30 @@ BR_REGISTER(Transform, ShowTransform) |
| 510 | 510 | |
| 511 | 511 | /*! |
| 512 | 512 | * \ingroup transforms |
| 513 | + * \brief Show the training data | |
| 514 | + * \author Josh Klontz \cite jklontz | |
| 515 | + */ | |
| 516 | +class ShowTrainingTransform : public Transform | |
| 517 | +{ | |
| 518 | + Q_OBJECT | |
| 519 | + Q_PROPERTY(br::Transform *show READ get_show WRITE set_show RESET reset_show STORED false) | |
| 520 | + BR_PROPERTY(br::Transform*, show, make("Show")) | |
| 521 | + | |
| 522 | + void train(const TemplateList &data) | |
| 523 | + { | |
| 524 | + TemplateList dst; | |
| 525 | + show->project(data, dst); | |
| 526 | + } | |
| 527 | + | |
| 528 | + void project(const Template &src, Template &dst) const | |
| 529 | + { | |
| 530 | + dst = src; | |
| 531 | + } | |
| 532 | +}; | |
| 533 | +BR_REGISTER(Transform, ShowTrainingTransform) | |
| 534 | + | |
| 535 | +/*! | |
| 536 | + * \ingroup transforms | |
| 513 | 537 | * \brief Manual selection of landmark locations |
| 514 | 538 | * \author Scott Klum \cite sklum |
| 515 | 539 | */ | ... | ... |
openbr/plugins/slidingwindow.cpp
| ... | ... | @@ -257,10 +257,10 @@ BR_REGISTER(Transform, BuildScalesTransform) |
| 257 | 257 | |
| 258 | 258 | /*! |
| 259 | 259 | * \ingroup transforms |
| 260 | - * \brief Sample detection bounding boxes from integral images | |
| 260 | + * \brief Sample detection bounding boxes from without resizing | |
| 261 | 261 | * \author Josh Klontz \cite jklontz |
| 262 | 262 | */ |
| 263 | -class IntegralDetector : public Transform | |
| 263 | +class Detector : public Transform | |
| 264 | 264 | { |
| 265 | 265 | Q_OBJECT |
| 266 | 266 | Q_PROPERTY(br::Transform *transform READ get_transform WRITE set_transform RESET reset_transform) |
| ... | ... | @@ -268,7 +268,10 @@ class IntegralDetector : public Transform |
| 268 | 268 | |
| 269 | 269 | void train(const TemplateList &data) |
| 270 | 270 | { |
| 271 | - transform->train(cropTrainingSamples(data, getAspectRatio(data))); | |
| 271 | + const float aspectRatio = getAspectRatio(data); | |
| 272 | + TemplateList cropped = cropTrainingSamples(data, aspectRatio); | |
| 273 | + cropped.first().file.set("aspectRatio", aspectRatio); | |
| 274 | + transform->train(cropped); | |
| 272 | 275 | } |
| 273 | 276 | |
| 274 | 277 | void project(const Template &src, Template &dst) const |
| ... | ... | @@ -277,7 +280,7 @@ class IntegralDetector : public Transform |
| 277 | 280 | } |
| 278 | 281 | }; |
| 279 | 282 | |
| 280 | -BR_REGISTER(Transform, IntegralDetector) | |
| 283 | +BR_REGISTER(Transform, Detector) | |
| 281 | 284 | |
| 282 | 285 | /*! |
| 283 | 286 | * \ingroup transforms | ... | ... |
scripts/pedestrianBaselineLBP.sh
| ... | ... | @@ -12,8 +12,8 @@ fi |
| 12 | 12 | |
| 13 | 13 | ALG="Open+Cvt(Gray)+Rename(neg,0)+BuildScales(Blur(2)+LBP(1,2)+SlidingWindow(Hist(59)+Cat+LDA(isBinary=true),windowWidth=10,takeLargestScale=false,threshold=2),windowWidth=10,takeLargestScale=false,minScale=4)+ConsolidateDetections+Discard" |
| 14 | 14 | |
| 15 | -# Josh's new algorithm in progress | |
| 16 | -# ALG2="Open+Cvt(Gray)+Gradient+Bin(0,360,9,true)+Merge+Integral+IntegralDetector" | |
| 15 | +# Josh's new algorithm (in progress) | |
| 16 | +# ALG2="Open+Cvt(Gray)+Detector(Gradient+Bin(0,360,9,true)+Merge+Integral+SlidingWindow(Identity))" | |
| 17 | 17 | |
| 18 | 18 | br -useGui 0 \ |
| 19 | 19 | -algorithm "${ALG}" \ | ... | ... |