Commit 99ea035ff5a5541269e6e46ffbf1e6358de87010
1 parent
89f4ce30
some progress with the new detector
Showing
2 changed files
with
9 additions
and
6 deletions
openbr/plugins/slidingwindow.cpp
| @@ -257,10 +257,10 @@ BR_REGISTER(Transform, BuildScalesTransform) | @@ -257,10 +257,10 @@ BR_REGISTER(Transform, BuildScalesTransform) | ||
| 257 | 257 | ||
| 258 | /*! | 258 | /*! |
| 259 | * \ingroup transforms | 259 | * \ingroup transforms |
| 260 | - * \brief Sample detection bounding boxes from integral images | 260 | + * \brief Sample detection bounding boxes from without resizing |
| 261 | * \author Josh Klontz \cite jklontz | 261 | * \author Josh Klontz \cite jklontz |
| 262 | */ | 262 | */ |
| 263 | -class IntegralDetector : public Transform | 263 | +class Detector : public Transform |
| 264 | { | 264 | { |
| 265 | Q_OBJECT | 265 | Q_OBJECT |
| 266 | Q_PROPERTY(br::Transform *transform READ get_transform WRITE set_transform RESET reset_transform) | 266 | Q_PROPERTY(br::Transform *transform READ get_transform WRITE set_transform RESET reset_transform) |
| @@ -268,7 +268,10 @@ class IntegralDetector : public Transform | @@ -268,7 +268,10 @@ class IntegralDetector : public Transform | ||
| 268 | 268 | ||
| 269 | void train(const TemplateList &data) | 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 | void project(const Template &src, Template &dst) const | 277 | void project(const Template &src, Template &dst) const |
| @@ -277,7 +280,7 @@ class IntegralDetector : public Transform | @@ -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 | * \ingroup transforms | 286 | * \ingroup transforms |
scripts/pedestrianBaselineLBP.sh
| @@ -12,8 +12,8 @@ fi | @@ -12,8 +12,8 @@ fi | ||
| 12 | 12 | ||
| 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" | 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 | br -useGui 0 \ | 18 | br -useGui 0 \ |
| 19 | -algorithm "${ALG}" \ | 19 | -algorithm "${ALG}" \ |