
Grasping the essence of image processing and analysis algorithms may prove to be quite difficult. To simplify the comprehension of such algorithms, sugarcubeIT proposes ImaproFX, a Java FX user interface providing a dynamic visual feedback thanks to interactive controllers.
The real power of ImaproFX comes from it’s Java coding framework… Coders can create their own image analysis ribbons simply by extending and loading an abstract “ImaproRibbon” class :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
public class MyDemoRibbon extends ImaproRibbon { public @FXML Slider contrastSlider; public @FXML Slider luminositySlider; public MyDemoRibbon(final Environment env) { super(env, "ImaproFX Demo"); } @Override public Img process() { Img result = source.create(); int width = source.width(); int height = source.height(); double ctr = Math.tan(contrastSlider.getValue() / 100 * Math.PI / 2.0); double lum = luminositySlider.getValue() / 200; for (int band = 0; band < source.bands(); band++) { for (int y = 0; y < height; y++) for (int x = 0; x < width; x++) { float value = source.value(x, y, band); result.setValue(x, y, band, (value - 0.5f) * ctr + (2f * lum) + 0.5f); } } return result.inRange(); } public static void main(String... args) { ImaproFX.Launch(env -> new MyDemoRibbon(env)); } } |
Post written by Jean-Luc Bloechle