Android support

From BoofCV
Revision as of 08:13, 22 April 2012 by Maarten Van Lier (talk | contribs) (Initial version of the Android port page.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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 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

  • 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 (TODO: add link). Note that this is an incomplete port that may not have what you need, or may not work as expected.