Package com.alibaba.simpleimage.analyze.harris.io

Examples of com.alibaba.simpleimage.analyze.harris.io.InterestPointNListInfo


                    HarrisSurf tempalte_hs = new HarrisSurf(bi);
                    tempalte_hs.getDescriptions(tempalte_hs.detectInterestPoints(), true);
                    al = tempalte_hs.getGlobalNaturalInterestPoints();
                }
                if (al == null) al = new ArrayList<SURFInterestPointN>();
                InterestPointNListInfo ipl = new InterestPointNListInfo();
                ipl.setList(al);
                ipl.setWidth(bi == null ? 0 : bi.getWidth());
                ipl.setHeight(bi == null ? 0 : bi.getHeight());
                InterestPointNinfoWriter.writeComplete(target, ipl);

                // check
                InterestPointNListInfo ipl1 = InterestPointNInfoReader.readComplete(target);
                if (ipl.getList().size() != ipl1.getList().size()) {
                    System.out.println("Write failed:" + f.getName());
                }
            }
        }
    }
View Full Code Here


        Map<String, BufferedImage> logoImgs = new HashMap<String, BufferedImage>();

        for (File f : fs) {
            String logo_surf_name = f.getName();
            if (!logo_surf_name.endsWith("rsurfn")) continue;
            InterestPointNListInfo ipl = InterestPointNInfoReader.readComplete(f.getAbsolutePath());
            if (f.getName().startsWith("taobao_annual_des_1.png")) // read from a configuration file
            ipl.setMaxSize(30);
            logoPonits.put(logo_surf_name, ipl);

        }
        int q = tfs.length / 10;
        int end = (offset == 9) ? tfs.length : (offset + 1) * q;
        System.out.println("work task from " + (offset * q) + ",end of " + end);
        Color[] cs = { Color.RED, Color.GREEN, Color.BLUE };
        for (int i = offset * q; i < end; i++) {
            File tf = tfs[i];
            if (!tf.getName().endsWith("rsurfn")) continue;
            InterestPointNListInfo ipl = InterestPointNInfoReader.readComplete(tf.getAbsolutePath());

            List<SURFInterestPointN> targetPoint = ipl.getList();
            if (targetPoint.size() < ModifiableConst.getMinPointCount()) continue;
            for (Entry<String, InterestPointNListInfo> e : logoPonits.entrySet()) {
                InterestPointNListInfo logoipl = e.getValue();
                String logo_surf_name = e.getKey();
                List<SurfMatch> ms = null;
                try {
                    ms = SurfMatchPoints.findMatchesBBF(logoipl.getList(), targetPoint);
                } catch (Exception ex) {
                    ex.printStackTrace();
                }

                if (ms == null) continue;

                ms = SurfMatchPoints.filterFarMatchL(ms, logoipl.getWidth(), logoipl.getHeight());
                ms = SurfMatchPoints.filterJoins(ms);
                if (ms.size() < logoipl.getMaxSize()) continue;
                FileOutputStream fos;
                BufferedImage logo = logoImgs.get(logo_surf_name);
                if (logo == null) {
                    logo = ImageIO.read(new File(logo_img_path + logo_surf_name.replaceFirst(".rsurfn", "")));
                    logoImgs.put(logo_surf_name, logo);
View Full Code Here

TOP

Related Classes of com.alibaba.simpleimage.analyze.harris.io.InterestPointNListInfo

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.