/** * Get the top-N "best" responses found by the template matcher. * * @param numResponses The number of responses * @return the best responses found */ public FValuePixel[] getBestResponses(int numResponses) { Comparator<FValuePixel> comparator = mode.scoresAscending() ? FValuePixel.ReverseValueComparator.INSTANCE : FValuePixel.ValueComparator.INSTANCE; return TemplateMatcher.getBestResponses(numResponses, responseMap, getXOffset(), getYOffset(), comparator); }
/** * Get the top-N "best" responses found by the template matcher. * * @param numResponses The number of responses * @return the best responses found */ public FValuePixel[] getBestResponses(int numResponses) { Comparator<FValuePixel> comparator = mode.scoresAscending() ? FValuePixel.ReverseValueComparator.INSTANCE : FValuePixel.ValueComparator.INSTANCE; return getBestResponses(numResponses, responseMap, getXOffset(), getYOffset(), comparator); }
protected void computeSATs(FImage[] magnitudeMaps) { for (int i = 0; i < nbins; i++) { sats[i] = new SummedAreaTable(magnitudeMaps[i]); } }
/** * Returns the top n lines from the accumulator space. * The end points of the lines will have x coordinates at -2000 and 2000. * * @param n The number of lines to return * @return A list of lines */ public List<Line2d> getBestLines( int n ) { return getBestLines( n, accum, 0 ); }
/** * * @param f1 * @param f2 * @return correlation between two patches (assumed to be the same size) * calculated using {@link TemplateMatcherMode} */ private float ncc(FImage f1, FImage f2) { final float normcorr = TemplateMatcher.Mode.NORM_CORRELATION.computeMatchScore(f1.pixels, 0, 0, f2.pixels, 0, 0, f1.width, f1.height); return normcorr; }
private void computeTable(FImage image, boolean computeTilted) { if (computeTilted) { computeRotSqSumIntegralImages(image); } else { computeSqSumIntegralImages(image); } }
@Override public void analyseImage(FImage image) { computeTable(image, true); } }
@Override protected float computeMatchScore(final FImage image, final FImage template, final int x, final int y, final Object workingSpace) { final float[][] imageData = image.pixels; final float[][] templateData = template.pixels; return computeMatchScore(imageData, x, y, templateData, 0, 0, template.width, template.height); }
@Override protected float computeMatchScore(final FImage image, final FImage template, final int x, final int y, final Object workingSpace) { final float[][] imageData = image.pixels; final float[][] templateData = template.pixels; return computeMatchScore(imageData, x, y, templateData, 0, 0, template.width, template.height); }
/** * Constructor that creates an accumulator space for the given number * of segments. * * @param nSegments The number of segments. * @param onValue value of pixels considered on */ public HoughLines( int nSegments , float onValue) { this.setNumberOfSegments( nSegments ); this.onValue = onValue; }
@Override public void analyseImage(FImage image) { computeTable(image); } }
@Override public void analyseImage(FImage image) { computeTable(image); } }
/** * Returns the top line in the accumulator space. * The end points of the line will have x coordinates at -2000 and 2000. * * @return The strongest line in the accumulator space */ public Line2d getBestLine() { return getBestLine( accum, 0 ); }
/** * {@inheritDoc} * * @see org.openimaj.feature.FeatureVectorProvider#getFeatureVector() */ @Override public DoubleFV getFeatureVector() { return coDirHist.asMultidimensionalDoubleFV(); }
/** * Get the top-N "best" responses found by the template matcher. * * @param numResponses The number of responses * @return the best responses found */ public FValuePixel[] getBestResponses(int numResponses) { Comparator<FValuePixel> comparator = mode.scoresAscending() ? FValuePixel.ReverseValueComparator.INSTANCE : FValuePixel.ValueComparator.INSTANCE; return TemplateMatcher.getBestResponses(numResponses, responseMap, getXOffset(), getYOffset(), comparator); }
/** * Get the top-N "best" responses found by the template matcher. * * @param numResponses The number of responses * @return the best responses found */ public FValuePixel[] getBestResponses(int numResponses) { Comparator<FValuePixel> comparator = mode.scoresAscending() ? FValuePixel.ReverseValueComparator.INSTANCE : FValuePixel.ValueComparator.INSTANCE; return getBestResponses(numResponses, responseMap, getXOffset(), getYOffset(), comparator); }
/** * Returns the top n lines from the accumulator space. * The end points of the lines will have x coordinates at -2000 and 2000. * * @param n The number of lines to return * @return A list of lines */ public List<Line2d> getBestLines( int n ) { return getBestLines( n, accum, 0 ); }
/** * Construct a SAT for normal sum, squared sum and (optionally) tilted sum * from the provided image. * * @param image * the image. * @param computeTilted * if true compute the tilted features. */ public SummedSqTiltAreaTable(FImage image, boolean computeTilted) { computeTable(image, computeTilted); }
@Override protected float computeMatchScore(final FImage image, final FImage template, final int x, final int y, final Object workingSpace) { final float[][] imageData = image.pixels; final float[][] templateData = template.pixels; return computeMatchScore(imageData, x, y, templateData, 0, 0, template.width, template.height); }