/** * Recursively update the caches of all the stages to reflect the current * scale. * * @param s * the stage to update */ private void updateCaches(Stage s) { s.updateCaches(this); if (s.successStage != null) updateCaches(s.successStage); if (s.failureStage != null) updateCaches(s.failureStage); }
/** * Recursively update the caches of all the stages to reflect the current * scale. * * @param s * the stage to update */ private void updateCaches(Stage s) { s.updateCaches(this); if (s.successStage != null) updateCaches(s.successStage); if (s.failureStage != null) updateCaches(s.failureStage); }
/** * Set the current detection scale. This must be called before calling * {@link #classify(SummedSqTiltAreaTable, int, int)}. * <p> * Internally, this goes through all the stages and their individual * classifiers and pre-caches information related to the current scale to * avoid lots of expensive recomputation of values that don't change for a * given scale. * * @param scale * the current scale */ public void setScale(float scale) { this.cachedScale = scale; // following the OCV code... -2 to make a slightly smaller box within // window cachedW = Math.round(scale * (width - 2)); cachedH = Math.round(scale * (height - 2)); cachedInvArea = 1.0f / (cachedW * cachedH); updateCaches(root); }
/** * Set the current detection scale. This must be called before calling * {@link #classify(SummedSqTiltAreaTable, int, int)}. * <p> * Internally, this goes through all the stages and their individual * classifiers and pre-caches information related to the current scale to * avoid lots of expensive recomputation of values that don't change for a * given scale. * * @param scale * the current scale */ public void setScale(float scale) { this.cachedScale = scale; // following the OCV code... -2 to make a slightly smaller box within // window cachedW = Math.round(scale * (width - 2)); cachedH = Math.round(scale * (height - 2)); cachedInvArea = 1.0f / (cachedW * cachedH); updateCaches(root); }