Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7635149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:22:04+00:00 2026-05-31T07:22:04+00:00

I am using Java openCV, and i try to load a photo and run

  • 0

I am using Java openCV, and i try to load a photo and run the template matching over it.
The template matching method deals with Mat objects, so i need to load the images and convert them into Mat.

The way i do it is:

Bitmap i = BitmapFactory.decodeFile("/sdcard/TVguide/Detection/detected.jpg");
image = Utils.bitmapToMat(i);

This way i load a photo from my android SD card, and try to convert it into Mat object using the openCV method bitmapToMat.
The problem is that on the conversion, the application crashes.

Here is the LogCat:

            03-14 15:15:57.636: W/dalvikvm(1059): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/opencv/android/Utils;
            03-14 15:15:57.636: D/AndroidRuntime(1059): Shutting down VM
            03-14 15:15:57.636: W/dalvikvm(1059): threadid=1: thread exiting with uncaught exception (group=0x40015578)
            03-14 15:15:57.640: E/AndroidRuntime(1059): FATAL EXCEPTION: main
            03-14 15:15:57.640: E/AndroidRuntime(1059): java.lang.ExceptionInInitializerError
            03-14 15:15:57.640: E/AndroidRuntime(1059):     at com.marakana.Preview$3.onPictureTaken(Preview.java:191)
            03-14 15:15:57.640: E/AndroidRuntime(1059):     at android.hardware.Camera$EventHandler.handleMessage(Camera.java:565)
            03-14 15:15:57.640: E/AndroidRuntime(1059):     at android.os.Handler.dispatchMessage(Handler.java:99)
            03-14 15:15:57.640: E/AndroidRuntime(1059):     at android.os.Looper.loop(Looper.java:123)
            03-14 15:15:57.640: E/AndroidRuntime(1059):     at android.app.ActivityThread.main(ActivityThread.java:3687)
            03-14 15:15:57.640: E/AndroidRuntime(1059):     at java.lang.reflect.Method.invokeNative(Native Method)
            03-14 15:15:57.640: E/AndroidRuntime(1059):     at java.lang.reflect.Method.invoke(Method.java:507)
            03-14 15:15:57.640: E/AndroidRuntime(1059):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
            03-14 15:15:57.640: E/AndroidRuntime(1059):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
            03-14 15:15:57.640: E/AndroidRuntime(1059):     at dalvik.system.NativeStart.main(Native Method)
            03-14 15:15:57.640: E/AndroidRuntime(1059): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load opencv_java: findLibrary returned null
            03-14 15:15:57.640: E/AndroidRuntime(1059):     at java.lang.Runtime.loadLibrary(Runtime.java:429)
            03-14 15:15:57.640: E/AndroidRuntime(1059):     at java.lang.System.loadLibrary(System.java:554)
            03-14 15:15:57.640: E/AndroidRuntime(1059):     at org.opencv.android.Utils.<clinit>(Utils.java:86)
            03-14 15:15:57.640: E/AndroidRuntime(1059):     ... 10 more
            03-14 15:16:03.472: I/Process(1059): Sending signal. PID: 1059 SIG: 9

I can’t understand if i am doing something wrong or it is just a buggy openCV.

Thanks
Eyal

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T07:22:05+00:00Added an answer on May 31, 2026 at 7:22 am

    You need to convert your bitmap to the RGBA format:

    Bitmap bmp32 = i.copy(Bitmap.Config.ARGB_8888, true);
    

    Actually it is the most discussed problem on Android-OpenCV user-group: https://groups.google.com/group/android-opencv/

    The fix for this problem is already available in OpenCV trunk and will be included into the next release of OpenCV.

    Also you can read image using the OpenCV API:

    Mat image = Highgui.imread("/sdcard/TVguide/Detection/detected.jpg");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using java I am trying to develop a method using recursion to analyze a
Is there a way using Java to over-ride the browser authentication dialog box when
i'm using java on a big amount of data. [i try to simplify the
Using Java Generics, I tried to implement a generic console input method. public static
i'm trying to connect to ip camera from java using openCV. I see examples
using java code in windows i need to download several files from a directory
I'm using JavaCv with OpenCv 2.3 from Java (on Windows). Occasionally something goes wrong,
I recently started to work on openCV using java and so far it looks
Using Java (1.6) is it better to call the clear() method on a List
Using Java (1.6) I want to split an input string that has components of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.