Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

converting bitmap to Mat ( java, android)

Hi, i face problem in converting bitmap to Mat ( thru highgui)

i got the image by using built-in android camera API. What i need to do is capture image from camera, change that bitmap to Mat, then apply rgb2gray. Can i know what is the correct and recommended way to perform the async initialization if i were to use the highgui only?

converting bitmap to Mat ( java, android)

Hi, i face problem in converting bitmap to Mat ( thru highgui)

i got the image by using built-in android camera API. What i need to do is capture image from camera, change that bitmap to Mat, then apply rgb2gray. Can i know what is the correct and recommended way to perform the async initialization if i were to use the highgui only?

edit ( error message) ------------------------------------------------ 03-05 21:47:44.918: E/AndroidRuntime(29461): FATAL EXCEPTION: main 03-05 21:47:44.918: E/AndroidRuntime(29461): java.lang.UnsatisfiedLinkError: Native method not found: org.opencv.highgui.Highgui.imread_1:(Ljava/lang/String;)J 03-05 21:47:44.918: E/AndroidRuntime(29461): at org.opencv.highgui.Highgui.imread_1(Native Method) 03-05 21:47:44.918: E/AndroidRuntime(29461): at org.opencv.highgui.Highgui.imread(Highgui.java:349) 03-05 21:47:44.918: E/AndroidRuntime(29461): at com.example.finalcameraapi.Main.onActivityResult(Main.java:110) 03-05 21:47:44.918: E/AndroidRuntime(29461): at android.app.Activity.dispatchActivityResult(Activity.java:5293) 03-05 21:47:44.918: E/AndroidRuntime(29461): at android.app.ActivityThread.deliverResults(ActivityThread.java:3315) 03-05 21:47:44.918: E/AndroidRuntime(29461): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3362) 03-05 21:47:44.918: E/AndroidRuntime(29461): at android.app.ActivityThread.access$1100(ActivityThread.java:141) 03-05 21:47:44.918: E/AndroidRuntime(29461): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282) 03-05 21:47:44.918: E/AndroidRuntime(29461): at android.os.Handler.dispatchMessage(Handler.java:99) 03-05 21:47:44.918: E/AndroidRuntime(29461): at android.os.Looper.loop(Looper.java:137) 03-05 21:47:44.918: E/AndroidRuntime(29461): at android.app.ActivityThread.main(ActivityThread.java:5041) 03-05 21:47:44.918: E/AndroidRuntime(29461): at java.lang.reflect.Method.invokeNative(Native Method) 03-05 21:47:44.918: E/AndroidRuntime(29461): at java.lang.reflect.Method.invoke(Method.java:511) 03-05 21:47:44.918: E/AndroidRuntime(29461): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 03-05 21:47:44.918: E/AndroidRuntime(29461): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 03-05 21:47:44.918: E/AndroidRuntime(29461): at dalvik.system.NativeStart.main(Native Method)

converting bitmap to Mat ( java, android)

Hi, i face problem in converting bitmap to Mat ( thru highgui)

i got the image by using built-in android camera API. What i need to do is capture image from camera, change that bitmap to Mat, then apply rgb2gray. Can i know what is the correct and recommended way to perform the async initialization if i were to use the highgui only?

edit edit ( error message) message):

------------------------------------------------
03-05 21:47:44.918: E/AndroidRuntime(29461): FATAL EXCEPTION: main
03-05 21:47:44.918: E/AndroidRuntime(29461): java.lang.UnsatisfiedLinkError: Native method not found: org.opencv.highgui.Highgui.imread_1:(Ljava/lang/String;)J
03-05 21:47:44.918: E/AndroidRuntime(29461):    at org.opencv.highgui.Highgui.imread_1(Native Method)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at org.opencv.highgui.Highgui.imread(Highgui.java:349)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at com.example.finalcameraapi.Main.onActivityResult(Main.java:110)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at android.app.Activity.dispatchActivityResult(Activity.java:5293)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at android.app.ActivityThread.deliverResults(ActivityThread.java:3315)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at android.app.ActivityThread.handleSendResult(ActivityThread.java:3362)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at android.app.ActivityThread.access$1100(ActivityThread.java:141)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at android.os.Handler.dispatchMessage(Handler.java:99)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at android.os.Looper.loop(Looper.java:137)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at android.app.ActivityThread.main(ActivityThread.java:5041)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at java.lang.reflect.Method.invokeNative(Native Method)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at java.lang.reflect.Method.invoke(Method.java:511)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-05 21:47:44.918: E/AndroidRuntime(29461):    at dalvik.system.NativeStart.main(Native Method)

Method)