Difference between revisions of "Android support"

From BoofCV
Jump to navigationJump to search
Line 44: Line 44:


Basically, code for loading images was ported, while code to show windows was left out.
Basically, code for loading images was ported, while code to show windows was left out.
The code is available [http://dl.dropbox.com/u/16413201/BoofCV%20v0.2%20Partial%20Android%20Port.zip|here here]. Note that this is an incomplete port that may not have what you need, or may not work as expected.
The code is available here[http://dl.dropbox.com/u/16413201/BoofCV%20v0.2%20Partial%20Android%20Port.zip]. Note that this is an incomplete port that may not have what you need, or may not work as expected.

Revision as of 08:22, 22 April 2012

Android Support

This page is a summary of what needs to be done to port BoofCV to Android. The required libraries (EJML, GeoRegression and libpja) can be used without modification on Android. BoofCV itself is mostly compatible (all algorithms can just be used), but needs some modifications to be able to run:

  • Since there is no java swing library, all examples have to be adapted to use the Android activity system.
  • Since Android uses Bitmaps instead of BufferedImage, the code that converts BufferedImage objects to the internal representation needs to be changed to work with Bitmap objects.

Classes that need change

Please note that this list is based on the experience of a partial port of BoofCV v0.2.

  • core.image
    • ConvertBufferedImage needs to use Bitmaps
  • gui
    • This whole package needs to use Android Activities to show the results instead of java swing windows
  • io
    • io.image
      • UtilIO needs to use an activity for selectFile, so a file can be selected from the Android file system
      • ImageListManager needs to use Bitmap instead of BufferedImage
      • PlaybackImageSequance needs an activity to play back the sequence
      • ProcessImageSequence needs an activity to process and show the sequence
      • SelectInputImageToolBar is very swing specific and maybe not even needed for Android
      • SimpleImageSequence needs to use Bitmap instead of BufferedImage
      • UtilImageIO needs to use Bitmap instead of BufferedImage
    • io.video
      • BoofVideoManager => ?
      • VideoInterface => ?
      • VideoListManager => ?
    • io.wrapper.images
      • BufferedFileImageSequence probably just needs Bitmap instead of BufferedImage
      • JpegByteImageSequence probably just needs Bitmap instead of BufferedImage
      • LoadFileImageSequance probably just needs Bitmap instead of BufferedImage
  • testing
    • BoofTesting needs Bitmap instead of BufferedImage


Partial Android Port of BoofCV v0.2

For his master thesis, Maarten made a partial port of BoofCV v0.2 to Android. In this port, the following was done to get it working:

  • Just use the EJML, GeoRegression and libpja libraries that BoofCV uses, they work on Android as is.
  • Modify the core.image.ConvertBufferedImage class to the core.image.ConvertBitmap class. This new class uses BufferedImages and Android API calls to do the same as the ConvertBufferedImage class. The implementation is not as efficient as the original one, though.
  • Leave out the gui package because of the java swing windows that were used. It was not needed for the thesis.
  • Leave out problematic methods in io.image.UtilIO and remove other classes in io.image, io.video and io.wrapper.images, because they use java swing window calls. They were not needed for the thesis.
  • Leave out the methods in testing.BoofTesting that used the BufferedImage class.

Basically, code for loading images was ported, while code to show windows was left out. The code is available here[1]. Note that this is an incomplete port that may not have what you need, or may not work as expected.