本文整理汇总了Java中org.openimaj.image.model.EigenImages类的典型用法代码示例。如果您正苦于以下问题:Java EigenImages类的具体用法?Java EigenImages怎么用?Java EigenImages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EigenImages类属于org.openimaj.image.model包,在下文中一共展示了EigenImages类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getComponent
import org.openimaj.image.model.EigenImages; //导入依赖的package包/类
@Override
public Component getComponent(int width, int height) throws IOException {
final VFSGroupDataset<FImage> dataset = FaceDatasetProvider.getDataset();
final EigenImages eigen = EigenFaceApproximationDemo.loadEigen(dataset, "eigenbasis.bin");
final JPanel outer = new JPanel();
outer.setOpaque(false);
outer.setPreferredSize(new Dimension(width, height));
outer.setLayout(new GridBagLayout());
final JPanel base = new JPanel();
base.setOpaque(false);
base.setPreferredSize(new Dimension(width, height - 50));
base.setLayout(new FlowLayout());
for (int i = 0; i < 60; i++) {
final FImage img = eigen.visualisePC(i);
final ImageComponent ic = new ImageComponent(true, false);
ic.setAllowPanning(false);
ic.setAllowZoom(false);
ic.setShowPixelColours(false);
ic.setShowXYPosition(false);
ic.setImage(ImageUtilities.createBufferedImageForDisplay(img));
base.add(ic);
}
outer.add(base);
return outer;
}
示例2: Extractor
import org.openimaj.image.model.EigenImages; //导入依赖的package包/类
/**
* Construct with the requested number of components (the number of PCs
* to keep) and a face aligner. The principal components must be learned
* by calling {@link #train(List)}.
*
* @param numComponents
* the number of principal components to keep.
* @param aligner
* the face aligner
*/
public Extractor(int numComponents, FaceAligner<T> aligner) {
this(new EigenImages(numComponents), aligner);
}