Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2013 Alibaba.com All right reserved. This software is the
  * confidential and proprietary information of Alibaba.com ("Confidential
  * Information"). You shall not disclose such Confidential Information and shall
  * use it only in accordance with the terms of the license agreement you entered
  * into with Alibaba.com.
  */
 package com.alibaba.simpleimage.analyze.sift.scale;
 
类KDFeaturePoint.java的实现描述:该类主要将FeaturePoint的feature修改为整数以便在KDTree上查找

Author(s):
axman 2013-7-1 下午2:44:35
public class KDFeaturePoint extends IKDTreeDomain implements Cloneable {

    
    private static final long serialVersionUID = 814942706491557514L;
    
    public float              xy;
    public float              scale;
    public float              orientation;
    public KDFeaturePoint(){
    }
    public KDFeaturePoint(FeaturePoint fp){
        if (!fp.hasFeaturesthrow (new IllegalArgumentException(
                                                                 "While trying to generate integer "
                                                                         + "vector: source FeaturePoint has no feature vector yet"));
         = fp.x;
         = fp.y;
         = fp.scale;
         = fp.orientation;
         = fp.features.length;
         = new int[];
        for (int d = 0; d < ; ++d) {
            [d] = (int) (255.0 * fp.features[d]);
            if ([d] < 0 || [d] > 255) {
                throw (new IllegalArgumentException("Resulting integer descriptor k is not 0 <= k <= 255"));
            }
        }
    }
    public KDFeaturePoint clone() {
        KDFeaturePoint other = new KDFeaturePoint();
        other.dim = ;
        other.x = ;
        other.y = ;
        other.scale = ;
        other.orientation = ;
        other.descriptor = new int[];
        System.arraycopy(, 0, other.descriptor, 0, );
        return other;
    }
New to GrepCode? Check out our FAQ X