private void useRandom(BufferedImage image) { listOfFeatures = new LinkedList<SimpleFeature>(); int[] myKeypoint = new int[3]; Random r = new Random(); for (int i = 0; i < samplePoints; i++) { createNextRandomPoint(myKeypoint, image.getWidth(), image.getHeight(), r); globalFeature.extract(ImageUtils.cropImage(image, myKeypoint[0], myKeypoint[1], myKeypoint[2], myKeypoint[2])); listOfFeatures.add(new SimpleFeature(globalFeature.getFeatureVector(), myKeypoint[0], myKeypoint[1], myKeypoint[2], fieldName, featureName, globalFeatureClass)); } }
private void useRandom(BufferedImage image) { listOfFeatures = new LinkedList<SimpleFeature>(); int[] myKeypoint = new int[3]; Random r = new Random(); for (int i = 0; i < samplePoints; i++) { createNextRandomPoint(myKeypoint, image.getWidth(), image.getHeight(), r); globalFeature.extract(ImageUtils.cropImage(image, myKeypoint[0], myKeypoint[1], myKeypoint[2], myKeypoint[2])); listOfFeatures.add(new SimpleFeature(globalFeature.getFeatureVector(), myKeypoint[0], myKeypoint[1], myKeypoint[2], fieldName, featureName, globalFeatureClass)); } }
private void useGaussRandom(BufferedImage image) { listOfFeatures = new LinkedList<SimpleFeature>(); LinkedList<keypoint> keypointsList = createGaussRndPts(image.getWidth(), image.getHeight(), samplePoints); for (keypoint kpoint : keypointsList) { globalFeature.extract(ImageUtils.cropImage(image, (int) (kpoint.X - (kpoint.Size / 2)), (int) (kpoint.Y - (kpoint.Size / 2)), (int) kpoint.Size, (int) kpoint.Size)); listOfFeatures.add(new SimpleFeature(globalFeature.getFeatureVector(), (int) (kpoint.getX() - (kpoint.getSize() / 2)), (int) (kpoint.getY() - (kpoint.getSize() / 2)), (int) kpoint.getSize(), fieldName, featureName, globalFeatureClass)); } }
private void useGaussRandom(BufferedImage image) { listOfFeatures = new LinkedList<SimpleFeature>(); LinkedList<keypoint> keypointsList = createGaussRndPts(image.getWidth(), image.getHeight(), samplePoints); for (keypoint kpoint : keypointsList) { globalFeature.extract(ImageUtils.cropImage(image, (int) (kpoint.X - (kpoint.Size / 2)), (int) (kpoint.Y - (kpoint.Size / 2)), (int) kpoint.Size, (int) kpoint.Size)); listOfFeatures.add(new SimpleFeature(globalFeature.getFeatureVector(), (int) (kpoint.getX() - (kpoint.getSize() / 2)), (int) (kpoint.getY() - (kpoint.getSize() / 2)), (int) kpoint.getSize(), fieldName, featureName, globalFeatureClass)); } }
private void useCVSURF(BufferedImage image) { listOfFeatures = new LinkedList<SimpleFeature>(); LinkedList<CvSurfFeature> surfKeypoints = cvSurfExtractor.computeSurfKeypoints(image); for (CvSurfFeature keypoint : surfKeypoints) { globalFeature.extract(ImageUtils.cropImage(image, (int) (keypoint.getX() - (int) keypoint.getSize() / 2), (int) (keypoint.getY() - (int) keypoint.getSize() / 2), (int) keypoint.getSize(), (int) keypoint.getSize())); listOfFeatures.add(new SimpleFeature(globalFeature.getFeatureVector(), keypoint.getX(), keypoint.getY(), keypoint.getSize(), fieldName, featureName, globalFeatureClass)); } }
private void useCVSURF(BufferedImage image) { listOfFeatures = new LinkedList<SimpleFeature>(); LinkedList<CvSurfFeature> surfKeypoints = cvSurfExtractor.computeSurfKeypoints(image); for (CvSurfFeature keypoint : surfKeypoints) { globalFeature.extract(ImageUtils.cropImage(image, (int) (keypoint.getX() - (int) keypoint.getSize() / 2), (int) (keypoint.getY() - (int) keypoint.getSize() / 2), (int) keypoint.getSize(), (int) keypoint.getSize())); listOfFeatures.add(new SimpleFeature(globalFeature.getFeatureVector(), keypoint.getX(), keypoint.getY(), keypoint.getSize(), fieldName, featureName, globalFeatureClass)); } }
private void useCVSIFT(BufferedImage image) { listOfFeatures = new LinkedList<SimpleFeature>(); LinkedList<CvSiftFeature> cvSiftFeatures = cvSiftExtractor.computeSiftKeypoints(image); for (CvSiftFeature cvSiftFeature : cvSiftFeatures) { globalFeature.extract(ImageUtils.cropImage(image, (int) (cvSiftFeature.getX() - (int) cvSiftFeature.getSize() / 2), (int) (cvSiftFeature.getY() - (int) cvSiftFeature.getSize() / 2), (int) cvSiftFeature.getSize(), (int) cvSiftFeature.getSize())); listOfFeatures.add(new SimpleFeature(globalFeature.getFeatureVector(), cvSiftFeature.getX(), cvSiftFeature.getY(), cvSiftFeature.getSize(), fieldName, featureName, globalFeatureClass)); } }
private void useCVSIFT(BufferedImage image) { listOfFeatures = new LinkedList<SimpleFeature>(); LinkedList<CvSiftFeature> cvSiftFeatures = cvSiftExtractor.computeSiftKeypoints(image); for (CvSiftFeature cvSiftFeature : cvSiftFeatures) { globalFeature.extract(ImageUtils.cropImage(image, (int) (cvSiftFeature.getX() - (int) cvSiftFeature.getSize() / 2), (int) (cvSiftFeature.getY() - (int) cvSiftFeature.getSize() / 2), (int) cvSiftFeature.getSize(), (int) cvSiftFeature.getSize())); listOfFeatures.add(new SimpleFeature(globalFeature.getFeatureVector(), cvSiftFeature.getX(), cvSiftFeature.getY(), cvSiftFeature.getSize(), fieldName, featureName, globalFeatureClass)); } }