@Override public double getRadius(int featureIndex) { return detector.getRadius(featureIndex); }
@Override public synchronized void setActiveAlgorithm(int indexFamily, String name, Object cookie) { if (input == null) return; // corrupt the input image corruptPanel.corruptImage(grayImage, corruptImage); final InterestPointDetector<T> det = (InterestPointDetector<T>) cookie; det.detect(corruptImage); render.reset(); for (int i = 0; i < det.getNumberOfFeatures(); i++) { Point2D_F64 p = det.getLocation(i); int radius = (int) Math.ceil(det.getRadius(i)); render.addCircle((int) p.x, (int) p.y, radius); } SwingUtilities.invokeLater(new Runnable() { public void run() { ConvertBufferedImage.convertTo(corruptImage, workImage, true); Graphics2D g2 = workImage.createGraphics(); g2.setStroke(new BasicStroke(3)); render.draw(g2); panel.repaint(); } }); }
@Override public void process(GrayU8 gray) { detector.detect(gray); synchronized ( lockGui ) { foundGUI.reset(); int N = detector.getNumberOfFeatures(); for( int i = 0; i < N; i++ ) { Point2D_F64 p = detector.getLocation(i); double radius = detector.getRadius(i); foundGUI.grow().set(p.x, p.y, radius); } } } }
public static <TD extends TupleDesc> FastQueue<TD> describeImage( GrayF32 input , InterestPointDetector<GrayF32> detector , DescribeRegionPoint<GrayF32,TD> describe , List<Point2D_F64> location ) { FastQueue<TD> list = new FastQueue<>(100, describe.getDescriptionType(), false); System.out.println("Detecting"); detector.detect(input); System.out.println("Describing"); describe.setImage(input); for( int i = 0; i < detector.getNumberOfFeatures(); i++ ) { Point2D_F64 p = detector.getLocation(i); double radius = detector.getRadius(i); double ori = detector.getOrientation(i); TD d = describe.createDescription(); if( describe.process(p.x,p.y,ori,radius,d) ) { list.add( d ); location.add( p.copy() ); } } return list; }
double radius = detector.getRadius(i); if (describe.requiresOrientation()) { orientation.setObjectRadius(radius);
@Override public void updateGUI(BufferedImage guiImage, T origImage) { Graphics2D g2 = guiImage.createGraphics(); if( orientation != null ) orientation.setImage(origImage); render.reset(); for( int i = 0; i < detector.getNumberOfFeatures(); i++ ) { Point2D_F64 pt = detector.getLocation(i); int radius = (int)Math.round( detector.getRadius(i)); if( orientation != null ) { orientation.setObjectRadius(radius); double angle = orientation.compute(pt.x,pt.y); render.addCircle((int)pt.x,(int)pt.y,radius,Color.red,angle); } else { render.addCircle((int)pt.x,(int)pt.y,radius); } } render.draw(g2); if (panel == null) { panel = ShowImages.showWindow(guiImage, "Image Sequence", true); addComponent(panel); } else { panel.setImage(guiImage); panel.repaint(); } }
double radius = detector.getRadius(i); if (describe.requiresOrientation()) { orientation.setObjectRadius(radius);
@Override public void detect(T input) { descs.reset(); featureRadiuses.reset(); featureAngles.reset(); location.reset(); if( orientation != null ) { orientation.setImage(input); } describe.setImage(input); detector.detect(input); int N = detector.getNumberOfFeatures(); for( int i = 0; i < N; i++ ) { Point2D_F64 p = detector.getLocation(i); double radius = detector.getRadius(i); double yaw = detector.getOrientation(i); if( orientation != null ) { orientation.setObjectRadius(radius); yaw = orientation.compute(p.x,p.y); } if( describe.process(p.x,p.y,yaw,radius,descs.grow()) ) { featureRadiuses.push(radius); featureAngles.push(yaw); location.add(p); } else { descs.removeTail(); } } }