hqq128 / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

[Android + OpenCV] CanvasFrame (java.awt.image) #68

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I'm new in development and I have a problem with OpenCV and Android.
I try to use the functions CanvasFrame (like "CanvasFrame canvas = new 
CanvasFrame(false, "Out");") but java.awt.image is not available in Android.
I get the message "Could not find class 'java.awt.image.BufferedImage', 
referenced from method 
com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage"

What steps will reproduce the problem?
1. I compile my code with the line "CanvasFrame canvas = new CanvasFrame(false, 
"Out");"

What is the expected output? What do you see instead?
I obtain the message "Could not find class 'java.awt.image.BufferedImage', 
referenced from method 
com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage"

What version of the product are you using? On what operating system?
I use Eclipse Helios for Java, OpenCV 2.2, JavaCV (20110511) Android SDK 2.2, 
Ubuntu 10.10.

Thank you for your help and sorry for my bad english.

Original issue reported on code.google.com by rolland....@gmail.com on 12 May 2011 at 3:35

GoogleCodeExporter commented 9 years ago
Right, Android does not come with AWT, Swing, JFrame or Image, so CanvasFrame 
will not work. You will to use the Android equivalent classes

I guess we could have something like CanvasFrame that would work under Android, 
and that would be a request for enhancement, but I don't have any plans to make 
it myself

Original comment by samuel.a...@gmail.com on 13 May 2011 at 2:56

GoogleCodeExporter commented 9 years ago
Thanks for your answer,

I found that the android.graphics.Bitmap classe is equivalent to 
java.awt.ImageBufferedImage 
(http://stackoverflow.com/questions/3429437/how-to-use-java-awt-image-
package-in-android-app). So I will try to use this equivalent.

But, without this possibilities, the interest of JavaCV is limited for 
Android, no ? In my case, I try to make a Augmented Reality app but 
without display, I can't do this.

Thank you.

Original comment by rolland....@gmail.com on 13 May 2011 at 9:35

GoogleCodeExporter commented 9 years ago
We can easily copy data to a Bitmap, as I explained in issue #67...

Original comment by samuel.a...@gmail.com on 13 May 2011 at 12:18

GoogleCodeExporter commented 9 years ago
Issue 324 has been merged into this issue.

Original comment by samuel.a...@gmail.com on 13 Jun 2013 at 7:04