Menu

OpenIMAJ on Android Log in to Edit

Jonathon Hare Sina Samangooei

Introduction

Because efforts were made to guarantee that OpenIMAJ was written in pure java, most of the code base can be included in any android project in jar format and used directory. The only exceptions to this rule are the base ImageUtilities which cannot be used (as they use BufferedImage) and instead the user should construct OpenIMAJ images manually, often a case of filling a float array with pixel values.

This page will eventually contain a working android project which extracts SIFT features from images taken with an android phone.


Related

Wiki: Home

Discussion

  • Anonymous

    Anonymous - 2013-11-16

    when OpenIMAJ can support android?

     
  • Jonathon Hare

    Jonathon Hare - 2013-11-17

    As far as I'm aware it should all work now. The haar cascade stuff was re-written not to use javax.xml.stream a while ago. Please report any problems with android compatibility to the bug tracker: http://jira.openimaj.org

     
  • GuoQing

    GuoQing - 2013-11-18

    What I mean is create a OpenIMAJ core lib.jar. Currently, it is hard to port the whole project in Android since lots of java files across too many file folders.

     
  • Jonathon Hare

    Jonathon Hare - 2013-11-18

    OpenIMAJ with all the dependencies would probably be too big to make this practical in the general case. It is easy to create a custom jar with just the bits you need though: follow the instructions on getting started with maven in the tutorial (http://www.openimaj.org/tutorial/getting-started-with-openimaj-using-maven.html) to create a project using the archetype, then edit the pom.xml file to add/remove any parts of OpenIMAJ you don't want, then run "mvn assembly:assembly" to build a jar which you can use in your android project.

     
  • Anonymous

    Anonymous - 2014-07-15

    Is there anybody come out with a ready to use openimaj lib sets for android?

     
  • Jonathon Hare

    Jonathon Hare - 2014-07-15

    You can just add the required openimaj libraries and their dependencies to your android project (or follow the instructions in the comment above to create a fat jar with all the bits you need), or use the maven android plugin and do everything with maven...

    You'll probably need a way for converting Android Bitmaps to/from the openimaj image formats (i.e. MBFImage). Here's a helper class one of my students wrote:

    public class AndroidImageUtilities {
        public static Bitmap createBitmap(Image<?, ?> img, Bitmap bmap){
            if (bmap == null || bmap.getWidth() != img.getWidth() || bmap.getHeight() != img.getHeight() || bmap.getConfig() != Bitmap.Config.ARGB_8888){
                bmap = Bitmap.createBitmap(img.getWidth(), img.getHeight(), Bitmap.Config.ARGB_8888);
            }
            bmap.setPixels(img.toPackedARGBPixels(), 0, img.getWidth(), 0, 0, img.getWidth(), img.getHeight());
            return bmap;
        }
    
        public static MBFImage createMBFImage(Bitmap image, boolean alpha){
            final int[] data = new int[image.getHeight()*image.getWidth()];
            image.getPixels(data, 0, image.getWidth(), 0, 0, image.getWidth(), image.getHeight());
            return new MBFImage(data, image.getWidth(), image.getHeight(), alpha);
        }
    
        public static void viewImage(Image<?, ?> img, ImageView view){
            Bitmap image = createBitmap(img, null);
            view.setImageBitmap(image);
        }
    }
    
     
  • Anonymous

    Anonymous - 2015-04-15
    Post awaiting moderation.
  • Anonymous

    Anonymous - 2015-06-02

    Cannot find any class inside org.openimaj.ml.gmm however documentation says there exist GaussianMixtureModelEM class. Dont know what am I doing wrong I downloaded Clustering Library 1.3.1 jar file.
    Any help would be appriciated

     
    • Jonathon Hare

      Jonathon Hare - 2015-06-02

      It's definitely in the clustering jar:

      jar tvf clustering-1.3.1.jar | grep GaussianMixtureModelEM
         257 Wed Sep 24 22:03:20 BST 2014 org/openimaj/ml/gmm/GaussianMixtureModelEM$1.class
        3382 Wed Sep 24 22:03:20 BST 2014 org/openimaj/ml/gmm/GaussianMixtureModelEM$CovarianceType$1.class
        3153 Wed Sep 24 22:03:20 BST 2014 org/openimaj/ml/gmm/GaussianMixtureModelEM$CovarianceType$2.class
        3300 Wed Sep 24 22:03:20 BST 2014 org/openimaj/ml/gmm/GaussianMixtureModelEM$CovarianceType$3.class
        3131 Wed Sep 24 22:03:20 BST 2014 org/openimaj/ml/gmm/GaussianMixtureModelEM$CovarianceType$4.class
        2422 Wed Sep 24 22:03:20 BST 2014 org/openimaj/ml/gmm/GaussianMixtureModelEM$CovarianceType.class
         681 Wed Sep 24 22:03:20 BST 2014 org/openimaj/ml/gmm/GaussianMixtureModelEM$EMGMM.class
        1327 Wed Sep 24 22:03:20 BST 2014 org/openimaj/ml/gmm/GaussianMixtureModelEM$UpdateOptions.class
        7717 Wed Sep 24 22:03:20 BST 2014 org/openimaj/ml/gmm/GaussianMixtureModelEM.class
      
       
  • Anonymous

    Anonymous - 2019-01-23
    Post awaiting moderation.

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.