/** * Create a feature from the given data. The specific type of feature * created depends on whether or not the feature is tilted. * * @param rectList * the rectangles defining the feature * @param tilted * is the feature tilted? * @return the new {@link HaarFeature} object. */ public static HaarFeature create(List<WeightedRectangle> rectList, boolean tilted) { final WeightedRectangle[] rects = rectList.toArray(new WeightedRectangle[rectList.size()]); if (tilted) return new TiltedFeature(rects); return new NormalFeature(rects); }
rects[2] = new WeightedRectangle(x2, y2, w2, h2, wt2); return tilted ? new TiltedFeature(rects) : new NormalFeature(rects);
rects[2] = new WeightedRectangle(x2, y2, w2, h2, wt2); return tilted ? new TiltedFeature(rects) : new NormalFeature(rects);
rects[1] = new WeightedRectangle(x1, y1, w1, h1, wt1); return tilted ? new TiltedFeature(rects) : new NormalFeature(rects);
rects[1] = new WeightedRectangle(x1, y1, w1, h1, wt1); return tilted ? new TiltedFeature(rects) : new NormalFeature(rects);
/** * Create a feature from the given data. The specific type of feature * created depends on whether or not the feature is tilted. * * @param rectList * the rectangles defining the feature * @param tilted * is the feature tilted? * @return the new {@link HaarFeature} object. */ public static HaarFeature create(List<WeightedRectangle> rectList, boolean tilted) { final WeightedRectangle[] rects = rectList.toArray(new WeightedRectangle[rectList.size()]); if (tilted) return new TiltedFeature(rects); return new NormalFeature(rects); }