Package com.alibaba.security.simpleimage.analyze.sift

Examples of com.alibaba.security.simpleimage.analyze.sift.ImageMap


    public enum Direction {
        VERTICAL, HORIZONTAL
    }

    public static ImageMap convolve(ImageMap img, ConvLinearMask mask) {
        ImageMap im1 = new ImageMap(img.xDim, img.yDim);
        ImageMap im2 = new ImageMap(img.xDim, img.yDim);;
        convolve1D(im1, mask, img, Direction.VERTICAL);
        convolve1D(im2, mask, im1, Direction.HORIZONTAL);
        return im2;
    }
View Full Code Here


        if (verbose) System.out.printf("FindPeaks: scale %9.2f, testing %d levels\r\n", basePixScale,
                                       this.spaces.length - 2);

        ArrayList<ScalePoint> peaks = new ArrayList<ScalePoint>();

        ImageMap current, above, below;

        // Search the D(k * sigma) to D(2 * sigma) spaces
        for (int level = 1; level < (this.spaces.length - 1); ++level) {
            current = this.spaces[level];
            below = this.spaces[level - 1];
View Full Code Here

        // consider is (3 * sigma) (until the weight becomes very small).
        double sigma = 3.0 * kpScale;
        int radius = (int) (3.0 * sigma / 2.0 + 0.5);
        int radiusSq = radius * radius;

        ImageMap magnitude = magnitudes[point.level];
        ImageMap direction = directions[point.level];

        // As the point may lie near the border, build the rectangle
        // coordinates we can still reach, minus the border pixels, for which
        // we do not have gradient information available.
        int xMin = Math.max(point.x - radius, 1);
View Full Code Here

        // top left border corner -> * * *
        // * [*] *
        // * * *
        //
        for (int s = 1; s < (this.getCount() - 1); ++s) {
            magnitudes[s] = new ImageMap(imgScaled[s].xDim, imgScaled[s].yDim);
            directions[s] = new ImageMap(imgScaled[s].xDim, imgScaled[s].yDim);

            for (int y = 1; y < (imgScaled[s].yDim - 1); ++y) {
                for (int x = 1; x < (imgScaled[s].xDim - 1); ++x) {
                    // gradient magnitude m
                    magnitudes[s].valArr[y][x] = Math.sqrt(Math.pow(imgScaled[s].valArr[y][x + 1]
View Full Code Here

        // maps. But for the minima/maxima pixel search, we need two more. See
        // BuildDiffMaps.
        imgScaled = new ImageMap[scales + 1 + 1 + 1];
        this.basePixScale = firstScale;
        // Ln1(x, y, k^{p+1}) = G(x, y, \sqrt{k^2-1}) * Ln0(x, y, k^p).
        ImageMap prev = first;
        imgScaled[0] = first;

        double w = sigma;
        double kTerm = Math.sqrt(Math.pow(SToK(scales), 2.0) - 1.0);
        for (int scI = 1; scI < imgScaled.length; ++scI) {
View Full Code Here

         */
        ref.val = 0.0;
        if (point.level <= 0 || point.level >= (spaces.length - 1)) throw (new IllegalArgumentException(
                                                                                                        "point.Level is not within [bottom-1;top-1] range"));

        ImageMap below = spaces[level - 1];
        ImageMap current = spaces[level];
        ImageMap above = spaces[level + 1];

        SimpleMatrix H = new SimpleMatrix(3, 3);
        /*
         * 下面是该幅图像尺度空间的三元偏导数,记住是尺度空间上 的二阶自变量为3的偏导数2006.3.1
         */
 
View Full Code Here

            // Points we cannot say anything about, as they lie on the border
            // of the scale space
            if (point.level <= 0 || point.level >= (spaces.length - 1)) return (true);

            ImageMap space = spaces[point.level];
            if (x <= 0 || x >= (space.xDim - 1)) return (true);
            if (y <= 0 || y >= (space.yDim - 1)) return (true);

            RefDouble dp = new RefDouble();
            SimpleMatrix adj = getAdjustment(point, point.level, x, y, dp);
View Full Code Here

    public ImageMap toImageMap(IPixelConverter converter) {
        // if (converter == null) {
        // converter = new CanonicalPixelConverter();
        // }
        ImageMap res = new ImageMap(this.bimg.getWidth(), this.bimg.getHeight());
        int h = this.bimg.getHeight();
        int w = this.bimg.getWidth();
        //int[] pix = bimg.getRGB(0,0, w, h,null, 0, w*3); 无优化必要
        for (int y = 0; y < h; y++) {
            for (int x = 0; x < w; x++) {
View Full Code Here

    }

    public int buildOctaves(ImageMap source, double scale, int levelsPerOctave, double octaveSigm, int minSize) {
        this.octaves = new ArrayList<DScaleSpace>();
        DScaleSpace downSpace = null;
        ImageMap prev = source;

        while (prev != null && prev.xDim >= minSize && prev.yDim >= minSize) {
            DScaleSpace dsp = new DScaleSpace();
            dsp.verbose = verbose;
View Full Code Here

TOP

Related Classes of com.alibaba.security.simpleimage.analyze.sift.ImageMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.