1

I'm trying to follow the tutorial here https://boofcv.org/index.php?title=Example_Image_Stitching to test how it works on Android.

after copying and pasting the example code I got errors saying cannot resolve symbol BufferedImage and Graphics2D. I tried googling to find the correct jar but found people were saying the jar isn't available because it is native code. then how does this example work?

Thanks

user1865027
  • 3,505
  • 6
  • 33
  • 71
  • Not sure this needed a downvote (whoever did it); the cut-down nature of the Android java implementation is sometime very annoying and obtuse. – RabidMutant Apr 28 '17 at 14:01

3 Answers3

1

BufferedImage can not be used in Android. For image stitching in Android, you need to use OpenCV or you can use JavaCV.

You can check below links: https://ramsrigoutham.com/2012/12/21/panorama-app-on-android-using-stitching-module-opencv/

Is it possible to do panorama Image Stitching in Android from Java?

Image stitching in android using OpenCV

Community
  • 1
  • 1
Sonam
  • 572
  • 4
  • 13
0

Android has a subset of the standard Java libraries. BufferedImage is not included.

RabidMutant
  • 595
  • 5
  • 19
  • btu where can i find the jar? i can see the parent class of the example i'm referring to imports java.awt.image – user1865027 Apr 26 '17 at 01:48
  • It's part of awt which is not in Android. You need to use other methods; Bitmap is the Android equivalent but deeply underpowered for image tiling (of very large images). – RabidMutant Apr 26 '17 at 01:51
  • ok..i dont understand why that example would work. I guess i'm out of luck to implement it in android – user1865027 Apr 26 '17 at 01:56
  • It's *possible* BoofCV does not use AWT (I have not looked), but the example code does use AWT. It may be worth asking the BoofCV people about Android support, then adapting the code to use a Bitmap – RabidMutant Apr 26 '17 at 02:00
  • Fwiw, you can do tiling with the various Bitmap methods (there's one that loads part of an image from file), it just won't perform as fast as native c code. – RabidMutant Apr 26 '17 at 04:34
0

It's not "native code", but it is only included in the Java SE AWT package, which is not part of the Android SDK

Bitmap is an equivalent class

A Canvas would be similar to the Graphics2D

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245