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


Java RGBColour.randomColour方法代码示例

本文整理汇总了Java中org.openimaj.image.colour.RGBColour.randomColour方法的典型用法代码示例。如果您正苦于以下问题:Java RGBColour.randomColour方法的具体用法?Java RGBColour.randomColour怎么用?Java RGBColour.randomColour使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openimaj.image.colour.RGBColour的用法示例。


在下文中一共展示了RGBColour.randomColour方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.openimaj.image.colour.RGBColour; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
	final List<PointList> pointData = loadData();
	final PointListConnections plc = loadConnections();
	final List<FImage> images = loadImages();

	System.out.println(pointData.size());
	System.out.println(images.size());

	final Float[][] cols = new Float[pointData.get(0).size()][];
	for (int i = 0; i < cols.length; i++)
		cols[i] = RGBColour.randomColour();

	for (int j = 0; j < pointData.size(); j++) {
		final PointList pl = pointData.get(j);
		final MBFImage img = images.get(j).toRGB();

		final List<Line2d> lines = plc.getLines(pl);
		img.drawLines(lines, 1, RGBColour.RED);

		for (int i = 0; i < pl.size(); i++) {
			final Point2d pt = pl.get(i);
			img.drawPoint(pt, cols[i], 3);
		}
		DisplayUtilities.display(img);
	}
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:27,代码来源:PDMTest.java

示例2: renderSegments

import org.openimaj.image.colour.RGBColour; //导入方法依赖的package包/类
/**
 * Render the components to the image with randomly assigned colours.
 * 
 * @param image
 *            Image to draw to
 * @param components
 *            the components
 * @return the image
 */
public static MBFImage renderSegments(MBFImage image, List<? extends PixelSet> components) {
	for (final PixelSet cc : components) {
		final BlobRenderer<Float[]> br = new BlobRenderer<Float[]>(image, RGBColour.randomColour());
		br.process(new ConnectedComponent(cc.pixels));
	}

	return image;
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:18,代码来源:SegmentationUtilities.java


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