Giter Site home page Giter Site logo

fhooeaist / imaging Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 2.0 89.56 MB

One Framework to rule them all, One Framework to find them, One Framework to bring them all and in the darkness bind them. - The ring's inscription, translated, adapted.

Home Page: https://fhooeaist.github.io/imaging/

License: Mozilla Public License 2.0

Java 100.00%
computer-vision image-processing imaging

imaging's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

imaging's Issues

Adapt the module packages

Is your feature request related to a problem? Please describe.
We should think of refactoring the packages in the additional modules and remove the additional "service" subpackage.

Describe the solution you'd like
Change packages like science.aist.imaging.service.mesh; to science.aist.imaging.mesh;.
Same for the other modules as core, imagej, mesh, microsoftcognitiveservices, nd4j, opencv, openimaj, pdfbox, tesseract, ...

Priority
Priority of this request Minor

Fix Javadoc Generation

The project is built using java11+, which means that everything that is not within a module gets assign to the default module. This causes the javadoc-search to work incorrectly.

...
<configuration>
    ...
    <additionalJOptions>
        <additionalJOption>--no-module-directories</additionalJOption>
    </additionalJOptions>
   ...
</configuration>
...

Add possiblity to chain multiple ImageFunctions

Allow chaining multiple image functions:
e.g.

ImageFunction<..> x = ...;
ImageFunction<..> y = ...;
var z = x.andThen(y);

Make sure that the interim result that is produced from x and used as an input of y, needs to be closed.

[BUG] Non-required dependencies

Describe the bug
There are multiple non-required maven dependencies left over from the open sourcing process.

To Reproduce
E.g. Look into API pom.xml

Expected behavior
Removed dependencies.

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

maven
api/pom.xml
  • science.aist.imaging:imaging 2.0.1-SNAPSHOT
core/pom.xml
  • science.aist.imaging:imaging 2.0.1-SNAPSHOT
  • science.aist.imaging:api ${project.parent.version}
imagej/pom.xml
  • science.aist.imaging:imaging 2.0.1-SNAPSHOT
  • science.aist.imaging:api ${project.parent.version}
javacv/pom.xml
  • science.aist.imaging:imaging 2.0.1-SNAPSHOT
  • science.aist.imaging:api 2.0.1-SNAPSHOT
mesh/pom.xml
  • science.aist.imaging:imaging 2.0.1-SNAPSHOT
  • science.aist.imaging:api ${project.parent.version}
microsoftcognitiveservices/pom.xml
  • science.aist.imaging:imaging 2.0.1-SNAPSHOT
  • science.aist.imaging:api ${project.parent.version}
  • science.aist.imaging:core ${project.parent.version}
nd4j/pom.xml
  • science.aist.imaging:imaging 2.0.1-SNAPSHOT
  • science.aist.imaging:api ${project.parent.version}
opencv/pom.xml
  • science.aist.imaging:imaging 2.0.1-SNAPSHOT
  • science.aist.imaging:api ${project.parent.version}
  • science.aist.imaging:core ${project.parent.version}
openimaj/pom.xml
  • science.aist.imaging:imaging 2.0.1-SNAPSHOT
  • science.aist.imaging:api ${project.parent.version}
openjfx/pom.xml
  • science.aist.imaging:imaging 2.0.1-SNAPSHOT
  • science.aist.imaging:api ${project.parent.version}
  • org.openjfx:javafx-media 11
pdfbox/pom.xml
  • science.aist.imaging:imaging 2.0.1-SNAPSHOT
pom.xml
  • net.imagej:ij 1.53g
  • org.bytedeco:javacv 1.5.6
  • org.bytedeco:javacv-platform 1.5.6
  • org.orbisgis:jdelaunay 0.5.3
  • org.springframework:spring-beans 4.3.7.RELEASE
  • org.springframework:spring-core 4.3.7.RELEASE
  • org.springframework:spring-context 4.3.7.RELEASE
  • org.springframework:spring-web 4.3.7.RELEASE
  • org.springframework:spring-webmvc 4.3.7.RELEASE
  • com.fasterxml.jackson.core:jackson-core 2.7.9
  • com.fasterxml.jackson.core:jackson-databind 2.7.9
  • com.fasterxml.jackson.core:jackson-annotations 2.7.9
  • org.nd4j:nd4j-api 1.0.0-beta7
  • org.nd4j:nd4j-native 1.0.0-beta7
  • science.aist:aistcv 4.5.3
  • com.drewnoakes:metadata-extractor 2.13.0
  • org.openimaj:core-image 1.3.10
  • org.apache.pdfbox:pdfbox 2.0.14
  • org.apache.maven.plugins:maven-project-info-reports-plugin 3.0.0
  • org.apache.maven.plugins:maven-javadoc-plugin 3.1.1
  • javax.activation:activation 1.1.1
  • javax.xml.bind:jaxb-api 2.3.0
  • com.sun.xml.bind:jaxb-core 2.3.0
  • com.sun.xml.bind:jaxb-impl 2.3.0
  • org.projectlombok:lombok 1.18.10
  • org.springframework:spring-beans 4.3.7.RELEASE
  • org.springframework:spring-core 4.3.7.RELEASE
  • org.springframework:spring-test 4.3.7.RELEASE
  • org.springframework:spring-context 4.3.7.RELEASE
  • org.testng:testng 6.11
  • science.aist.seshat:api 1.1.0
  • science.aist:jack 2.3.1
  • org.hamcrest:hamcrest-all 1.3
  • org.mockito:mockito-core 3.11.1
  • org.apache.maven.plugins:maven-scm-publish-plugin 3.0.0
  • org.sonatype.plugins:nexus-staging-maven-plugin 1.6.8
  • org.apache.maven.plugins:maven-javadoc-plugin 3.1.1
  • org.apache.maven.plugins:maven-site-plugin 3.8.2
  • org.apache.maven.wagon:wagon-webdav-jackrabbit 3.3.4
  • org.apache.maven.doxia:doxia-module-markdown 1.9
  • org.apache.maven.plugins:maven-surefire-plugin 2.18.1
  • org.apache.maven.plugins:maven-gpg-plugin 1.6
  • org.apache.maven.plugins:maven-release-plugin 2.5.3
  • org.jacoco:jacoco-maven-plugin 0.8.4
  • org.apache.maven.plugins:maven-dependency-plugin 3.1.1
  • org.apache.maven.plugins:maven-surefire-plugin 2.18.1
  • org.sonarsource.java:sonar-jacoco-listeners 5.14.0.18788
tesseract/pom.xml
  • science.aist.imaging:imaging 2.0.1-SNAPSHOT
  • org.bytedeco.javacpp-presets:tesseract-platform 3.04.01-1.3
  • science.aist.imaging:api ${project.parent.version}
  • science.aist.imaging:core ${project.parent.version}

  • Check this box to trigger a request for Renovate to run again on this repository

ChannelType Scale Function

Add a Scale Function to the ChannelType which allows to scale a given value from a source range to a target range, which is defined by the ChannelType's min and max values.

public double scale(double value, int channel, double currentMin, double currentMax) {
  ...
}

This function could be reused in the ImageWrapper implementations of e.g. OpenIMAJ or OpenJFX, where images are represented with a range from 0 to 1 instead of 0 to 255 as in other frameworks.

Add comparison to python/numpy

Describe the solution you'd like

Add a section to the readme that compares the performance of Imaging to Python/numpy to show the advantages of image processing in Java.

Add JavaFX support

Add support to JavaFX's Image class using the WritableImage class

    WritableImage wr =  new WritableImage(width, height);
    PixelWriter pw = wr.getPixelWriter();
    for (int x = 0; x < image.getWidth(); x++) {
       for (int y = 0; y < image.getHeight(); y++) {
          pw.setArgb(x, y, image.getRGB(x, y));
        }
    }

Can be converted to JavaFX's Image like:

new ImageView(wr).getImage();

ImageWrapper createCopy - Comfort overload

Add a comfort overload for createCopy() to the ImageWrapper interface

default <X> ImageWrapper<X> createCopy(Class<X> targetClass) {
        return createCopy(ImageFactoryFactory.getImageFactory(targetClass);
}

Usage of Wrappers

Is your feature request related to a problem? Please describe.
Currently, we are using two architectural concepts in the imaging project:

  • Image processing: Interchangable Wrapper classes (e.g. ImageWrapper)
  • Geometry: Rich domain implementations (e.g. JavaPoint2D, JavaPolygon2D, ...)

Describe the solution you'd like
To have a more consistent architecture it would be great if we move the rich implementations of e.g. JavaPoint2D to the associated WrapperClasses.

Priority
Minor priority, would also need a new major version.

Extend Readme - Multi Modul Example

Describe the solution you'd like
Extend the project readme by a multi modul example.
E.g. Loading an image with OpenCV, applying some OpenCV filter and further apply some API/OpenIMAJ/... filter.

[BUG] GenericImageConsumer.accept() does not close copy

Describe the bug
The GenericImageConsumer currently does not close the temporarily created copy in accept.

To Reproduce
Have a look at https://github.com/FHOOEAIST/imaging/blob/main/api/src/main/java/science/aist/imaging/api/GenericImageConsumer.java#L50

Expected behavior
Close temporarily created copy.
Change to:

    @Override
    public void accept(ImageWrapper<I> iImageWrapper, T t) {
        if(iImageWrapper.getSupportedType().equals(consumerFactory.getSupportedType())){
            consumer.accept(CastUtils.cast(iImageWrapper), t);
        } else {
            ImageWrapper<I2> copy = iImageWrapper.createCopy(consumerFactory);
            try {
              consumer.accept(copy, t);
              copy.copyTo(iImageWrapper);
            } finally {
               copy.close();
            }
        }
    }

GenericImageFunction

Is your feature request related to a problem? Please describe.
The idea of the Imaging project is to create a framework overarching image processing pipeline and to connect different Java libraries. Currently, it is required to manually convert ImageWrapper's to the required type of a specifc implementation (especially if you use it over module borders). So add a functionality to overcome those borders.

Describe the solution you'd like
Add a generic image function implementation that wraps any given ImageFunction and converts the actual input to the wrapped function's input (if necessary). In addition to that the wrapped function's result is in turn converted to an expected output (if necessary).

The code could look something like (not tested!):

public class GenericImageFunction<I, O> implements ImageFunction<?, O> {

   public GenericImageFunction(ImageFunction<I, ?> function, Class<I> functionInputType, Class<O> outputType){
     this(function, ImageFactoryFactory.getImageFactory(functionInputType), ImageFactoryFactory.getImageFactory(outputType));
   }

   public GenericImageFunction(ImageFunction<I, ?> function, ImageFactory<I> functionInputFactory, ImageFactory<O> outputFactory) {
    ... // initialize variables
  }

   public ImageWrapper<O> apply(ImageWrapper<?> image) {
       ImageWrapper<I> input;
       if(image.getSupportedType().equals(functionInputFactory.getSupportedType())){
           input = (ImageWrapper<I>) image;
       } else {
           input = image.createCopy(functionInputFactory);
       }

      ImageWrapper<?> functionResult = function.apply(input);
      
      if(functionResult.getSupportedType().equals(outputFactory.getSupportedType())){
           return (ImageWrapper<O>) functionResult;
       } else {
           ImageWrapper<O> result = functionResult.createCopy(outputFactory);
           functionResult.close();  // close interim result
           return result;
       }
   }
}

Requires a getSupportedType Function in ImageWrapper (compare to ImageFactory)

public interface ImageWrapper<I> {
   ...
   Class<I> getSupportedType();
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.