Package jMEF

Examples of jMEF.MixtureModel


   * @param   image  input image
   * @param   n      number of components in the mixture model
   * @return         a mixture of Gaussian of n components computed from the input image
   */
  public static MixtureModel loadMixtureModel(String path, BufferedImage image, int n){
    MixtureModel mm = MixtureModel.load(path);
    if (mm==null){
      PVector[]         px       = convertColorImageToPointSet3D(image);
      Vector<PVector>[] clusters = KMeans.run(px, n);
      mm = BregmanSoftClustering.initialize(clusters, new MultivariateGaussian());
      mm = BregmanSoftClustering.run(px, mm);
View Full Code Here


    String mixture_path  = String.format("%s%s_5D_%03d.mix", input_folder, image_name, n);
   
    // Read image and generate initial mixture model
    System.out.print("Read image and generate/load the mixture 5D : ");
    BufferedImage image = Image.readImage(image_path);
    MixtureModel  f     = Image.loadMixtureModel(mixture_path, image, n);
    System.out.println("ok");
   
    // Creates and save the statistical image
    System.out.print("Create the statistical image                : ");
    BufferedImage stat = Image.createImageFromMixtureModel(image.getWidth(), image.getHeight(), f);
View Full Code Here

TOP

Related Classes of jMEF.MixtureModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.