本文整理汇总了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);
}
}
示例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;
}