JMicroVision provides basic image processing functions and allows you to create new ones.

Requirements:

  • A Java IDE (Eclipse, Netbeans…)
  • The JAI (Java Advanced Imaging) API
  • The file “JMicroVision.jar” must be used as an external library

Create a plugin with Eclipse 3.2

  • File –> New –> Project:
    • Select Java Project.
    • Set a name and select a Java Runtime Environnement (JRE). If you are using a version of JMicroVision that includes the JRE, you can select this one. Otherwise, select at least a 1.5 version and the JRE must contain the JAI libraries.
    • In Java Settings: Libraries tab –> Add External JARs…: Select the JMicroVision.jar file (located in the installation directory of JMicroVision).
  • Create at least one new class that inherits of either ImageFactorySimplePluginOp or ImageFactoryDialogPluginOp (see documentation).
  • Build all.
  • Export a JAR archive: File –>Export… –>Java –> JAR file (the final file must be a JAR or ZIP archive).

Place the JAR or ZIP file in the "Plugins" directory, located in the root of the installation directory and restart JMicroVision.

Note: If you use JAR libraries that are not included in the JRE or in the JAI API, the JAR files must also be placed in the "Plugins" directory.

Special image operations

The JAI API offers numerous image operations and can be extended by creating new operations. A new operation class must inherit an OpImage Class (AreaOpImage, PointOpImage, StatisticsOpImage, WarpOpImage, UntiledOpImage...).

  • UntiledOpImage is a general class for single-source operations in which the values of all pixels in the source image contribute to the value of each pixel in the destination image. If you use this class, a property has to be set to the image before calling the function displayResultPreview(PlanarImage image) or before returning the final image.
    Property to set: image.setProperty("untiled operation", true);
  • If the final image does not result from one or a succession of operations (subclass of OpImage), but has new data, a property has to be set to the image before returning the final image. When pressing the "Add Image" button, a file dialog will appear to save the image to disk.
    Property to set: image.setProperty("Synthetic", true);

Source code examples

  • Subclass of ImageFactorySimplePluginOp:
  • Subclass of ImageFactoryDialogPluginOp:

 


Documentation
Copyright © 2002-2007 by Nicolas Roduit