本文整理匯總了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);
}