当前位置: 首页>>代码示例>>Java>>正文


Java HarrisIPD类代码示例

本文整理汇总了Java中org.openimaj.image.feature.local.interest.HarrisIPD的典型用法代码示例。如果您正苦于以下问题:Java HarrisIPD类的具体用法?Java HarrisIPD怎么用?Java HarrisIPD使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HarrisIPD类属于org.openimaj.image.feature.local.interest包,在下文中一共展示了HarrisIPD类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setup

import org.openimaj.image.feature.local.interest.HarrisIPD; //导入依赖的package包/类
/**
 * create the test images, draw a few ellipses on the test image, initialise the IPDEngine
 */
@Before public void setup(){
	image = new MBFImage(400,400,ColourSpace.RGB);
	ellipseDrawn = new Ellipse(200,200,100,50,Math.PI/4);
	
	image.fill(RGBColour.WHITE);
	image.createRenderer().drawShapeFilled(ellipseDrawn, RGBColour.BLACK);
	
	int derScale = 100;
	int intScale = derScale  * 3;
	InterestPointDetector<?> ipd;
	AbstractStructureTensorIPD aipd = new HarrisIPD(derScale,intScale);
	AffineAdaption affine = new AffineAdaption(aipd,new IPDSelectionMode.Threshold(0.1f));
	ipd = affine;
	engine = new EllipticIPDSIFTEngine((AffineAdaption)ipd);
	engine.setSelectionMode(new IPDSelectionMode.Count(2));
	engine.setAcrossScales(false);
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:21,代码来源:IPDEngineTest.java

示例2: main

import org.openimaj.image.feature.local.interest.HarrisIPD; //导入依赖的package包/类
@SuppressWarnings("unchecked")
	public static void main(String[] args) throws IOException{
		
		MBFImage image = ImageUtilities.readMBF(new File("/Users/ss/Development/descriptors/img1.png"));
		FImage fimage = Transforms.calculateIntensity(image).multiply(255f);
		
		File featureOut = new File("/Users/ss/Development/descriptors/img1-oi.features");
		List<InterestPointData> kps  = null;
		boolean force = true;
		float sd = (float) 1;
		HarrisIPD harrisIPD = new HarrisIPD(sd*0.7f,sd*1f,0.01f);
		if(!featureOut.exists() || force){
			harrisIPD.findInterestPoints(fimage);
			kps = new IPDSelectionMode.Threshold(10000).selectPoints(harrisIPD);
//			kps = new IPDSelectionMode.All().selectPoints(harrisIPD);
			IOUtils.writeBinary(featureOut,new ReadWriteableIPDList<InterestPointData>(kps){
				@Override
				protected InterestPointData createFeature() {
					return new InterestPointData();
				}
			});
		}
		else{
			kps = IOUtils.read(featureOut,ReadWriteableIPDList.class).value;
		}
		
		
		InterestPointVisualiser<Float[], MBFImage> visualiser = InterestPointVisualiser.visualiseInterestPoints(image, kps);
		MBFImage out = visualiser.drawPatches(RGBColour.RED, RGBColour.GREEN);
		
		JFrame f = DisplayUtilities.display(out,String.format("Showing %d feature", kps.size()));
		FeatureClickListener l = new FeatureClickListener();
		l.setImage(kps, image);
		f.getContentPane().addMouseListener(l);
		
	}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:37,代码来源:ImageIPD.java

示例3: main

import org.openimaj.image.feature.local.interest.HarrisIPD; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
		MBFImage image = ImageUtilities.readMBF(ImageIPDSIFTEngine.class.getResourceAsStream("/org/openimaj/image/feature/validator/graf/img1.ppm"));
		FImage fimage = Transforms.calculateIntensity(image);

		File featureOut = new File("/tmp/img1.oi-sift-features");
		LocalFeatureList<? extends InterestPointKeypoint<? extends InterestPointData>> kps = null;
		boolean force = true;
		HarrisIPD harrisIPD = new HarrisIPD(1.4f);
		harrisIPD.setImageBlurred(true);
		AffineAdaption affineIPD = new AffineAdaption(harrisIPD,new IPDSelectionMode.Threshold(250f));
		affineIPD.setFastDifferentiationScale(true);
		AbstractIPDSIFTEngine<EllipticInterestPointData> engine = new EllipticIPDSIFTEngine(affineIPD);
		engine.setFinderMode(new FinderMode.Basic<EllipticInterestPointData>());
//		engine.setFinderMode(new FinderMode.Basic<InterestPointData>());
//		engine.setSelectionMode(new IPDSelectionMode.Threshold(10000f));
		engine.setSelectionMode(new IPDSelectionMode.All());
		engine.setAcrossScales(true);
		if (!featureOut.exists() || force) {
			kps = engine.findFeatures(fimage);
			IOUtils.writeBinary(featureOut, kps);
		} else {
			kps = MemoryLocalFeatureList.read(featureOut,
					CircularInterestPointKeypoint.class);
		}

		InterestPointVisualiser<Float[], MBFImage> visualiser = InterestPointVisualiser
				.visualiseKeypoints(image, kps);
		MBFImage out = visualiser.drawPatches(RGBColour.RED, RGBColour.GREEN);

		JFrame f = DisplayUtilities.display(out);
		FeatureClickListener l = new FeatureClickListener();
		l.setImage(kps, image);
		l.setDisplayFrame(f);
		f.getContentPane().addMouseListener(l);

	}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:37,代码来源:ImageIPDSIFTEngine.java

示例4: getNewEngine

import org.openimaj.image.feature.local.interest.HarrisIPD; //导入依赖的package包/类
private IPDSIFTEngine getNewEngine() {
	final int derScale = 1;
	final int intScale = 3;
	final HarrisIPD ipd = new HarrisIPD(derScale, intScale);
	engine = new IPDSIFTEngine(ipd);
	engine.setSelectionMode(new IPDSelectionMode.Threshold(10000f));
	engine.setFinderMode(new FinderMode.Characteristic<InterestPointData>());
	// engine.setSelectionMode(new IPDSelectionMode.Count(10));
	engine.setAcrossScales(true);

	return engine;
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:13,代码来源:VideoIPD.java


注:本文中的org.openimaj.image.feature.local.interest.HarrisIPD类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。