本文整理汇总了Java中org.openimaj.image.FImage.drawShapeFilled方法的典型用法代码示例。如果您正苦于以下问题:Java FImage.drawShapeFilled方法的具体用法?Java FImage.drawShapeFilled怎么用?Java FImage.drawShapeFilled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openimaj.image.FImage
的用法示例。
在下文中一共展示了FImage.drawShapeFilled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCircle
import org.openimaj.image.FImage; //导入方法依赖的package包/类
/**
* Test
*/
@Test
public void testCircle() {
final int imgWidthHeight = 200;
final FImage circleImage = new FImage(imgWidthHeight, imgWidthHeight);
final Circle c = new Circle(imgWidthHeight / 2 + 3, imgWidthHeight / 2 + 1, imgWidthHeight / 4);
circleImage.drawShapeFilled(c, 1f);
final CannyEdgeDetector det = new CannyEdgeDetector();
final FImage edgeImage = circleImage.process(det);
final HoughCircles circ = new HoughCircles(5, imgWidthHeight, 5, 360);
edgeImage.analyseWith(circ);
final List<WeightedCircle> best = circ.getBest(1);
final WeightedCircle b = best.get(0);
assertTrue(b.equals(c));
}
示例2: generateData
import org.openimaj.image.FImage; //导入方法依赖的package包/类
public static List<IndependentPair<PointList, FImage>> generateData(int number) {
final List<IndependentPair<PointList, FImage>> data = new ArrayList<IndependentPair<PointList, FImage>>(number);
final Random rnd = new Random();
for (int i = 0; i < number; i++) {
final float c1 = rnd.nextFloat();
float c2 = rnd.nextFloat();
while (Math.abs(c1 - c2) < 0.1) {
c2 = rnd.nextFloat();
}
final Triangle t = new Triangle(
new Point2dImpl(((float) i / (number - 1)) * 80 + 10f, 10),
new Point2dImpl(90, 90),
new Point2dImpl(10, 90)
);
final FImage img = new FImage(100, 100);
img.fill(Math.min(c1, c2));
img.drawShapeFilled(t, Math.max(c1, c2));
data.add(new IndependentPair<PointList, FImage>(t.asPolygon(), img));
}
return data;
}
示例3: loadReference
import org.openimaj.image.FImage; //导入方法依赖的package包/类
protected void loadReference() {
referenceTriangles = CLMFaceTracker.getTriangles(config.referenceShape, null, this.config.triangles);
mask = new FImage(size, size);
for (final Triangle t : referenceTriangles) {
// magic numbers chosen to scale and centre the face
// with a small border
t.scale(0.3f * size);
t.translate(0.5f * size, 0.45f * size);
mask.drawShapeFilled(t, 1f);
}
}
示例4: DoGColourSIFTEngineTest
import org.openimaj.image.FImage; //导入方法依赖的package包/类
/**
* Constructor
*/
public DoGColourSIFTEngineTest() {
FImage blankImage = new FImage(300,300);
FImage testImage = new FImage(300,300);
testImage.drawShapeFilled(new Circle(150 ,150, 50), 1f);
im1 = new MBFImage(testImage, blankImage, blankImage);
im2 = new MBFImage(blankImage, testImage, blankImage);
im3 = new MBFImage(blankImage, blankImage, testImage);
}
示例5: getROIMap
import org.openimaj.image.FImage; //导入方法依赖的package包/类
/**
* @return a mask image showing the region of interest.
*/
public FImage getROIMap() {
FImage image = new FImage(dofMap.width, dofMap.height);
image.drawShapeFilled(calculateROI(), 1f);
return image;
}