Ask Your Question

alvise's profile - activity

2016-03-30 04:15:35 -0600 received badge  Popular Question (source)
2013-03-20 04:24:52 -0600 answered a question Android camera problem

Have you tried to add the permission to use the camera in the AndroidManifest.xml?

<uses-permission android:name="android.permission.CAMERA" />

<uses-feature
    android:name="android.hardware.camera"
    android:required="false" />
<uses-feature
    android:name="android.hardware.camera.autofocus"
    android:required="false" />
<uses-feature
    android:name="android.hardware.camera.front"
    android:required="false" />
<uses-feature
    android:name="android.hardware.camera.front.autofocus"
    android:required="false" />
2013-03-19 13:46:56 -0600 commented answer OpenCV for Android & HTC One X

thank you for you time, much appreciated! I'm using the stock version 4.1.1, the last update and the last OpencvManager...

Anyway thank you!

2013-03-19 08:54:31 -0600 asked a question OpenCV for Android & HTC One X

Hi everybody,
I'm working on a Opencv project that I test on a HTC One X. Since I need to use the camera, I was wondering if there are differences between using the class VideoCapture from the Java code and using the same class through a native C++ code.
Now I'm trying to work using native code and displaying the camera preview frames using OpenGL, but I'm getting all black frames...maybe the camera is not supported? From the logcat I don't see any error messages and the camera capabilities, resolutions and so on are all displayed.
Does anybody have experienced a similar problem? Maybe using the VideoCapture java class can solve the problem?

thank you

2013-03-18 13:07:11 -0600 received badge  Scholar (source)
2013-03-18 13:07:07 -0600 received badge  Supporter (source)
2013-03-18 13:06:57 -0600 commented answer Problems using libnative_camera on Android

yes, you are right...I was misunderstanding the use of the callback. However now I'm facing another problem, I need the onPause() and onResume() methods to call onResume() and onPause() of a GLSurfaceView object, but, since the callback doesn't returned yet (and so the GLSurfaceView has not its renderer), I have some nullPointerException. Is there a way to make the callback a blocking call? Maybe I'm using the wrong approach? Thank you Alexander

2013-03-18 10:49:42 -0600 asked a question Problems using libnative_camera on Android

Hi all, after a lot of searching and tries I didn't manage to solve my problem. I'm trying to use the native camera module (through cv::VideoCapture initiated in a C++ source file) in an Android 4.1 project using JNI. I'm using Eclipse and everything compile, both "libnative_camera_r4.1.1.so" and "libNativeCamera.so" module are included in the compiled APK inside the lib/armeabi-v7a/ folder. However, I get this message error in the logcat when I try to run it:

03-18 16:33:07.367: W/dalvikvm(18039): No implementation found for native Lorg/opencv/highgui/VideoCapture;.n_VideoCapture:(I)J
03-18 16:33:07.372: W/dalvikvm(18039): threadid=1: thread exiting with uncaught exception (group=0x40e262d0)
03-18 16:33:07.372: E/AndroidRuntime(18039): java.lang.UnsatisfiedLinkError: Native method not found: org.opencv.highgui.VideoCapture.n_VideoCapture:(I)J

I'm quite sure that all the JNI methods defined by me link properly.
Why this error happens before the load of the OpenCV libraries by the OpenCVManager?
This is my android.mk file:

LOCAL_PATH  := $(call my-dir)
SDK_DIR     := /home/alvise/android/OpenCV-2.4.4-android-sdk
SDK_JNI_DIR := $(SDK_DIR)/sdk/native/jni

include $(CLEAR_VARS)


#OPENCV_CAMERA_MODULES:=on
#OPENCV_INSTALL_MODULES:=on
#OPENCV_LIB_TYPE:=STATIC
include $(SDK_JNI_DIR)/OpenCV.mk

### CAMERA MODULE
include $(CLEAR_VARS)
LOCAL_MODULE := camera-prebuilt
LOCAL_SRC_FILES = build/libs/$(TARGET_ARCH_ABI)/libnative_camera_r4.1.1.so
include $(PREBUILT_SHARED_LIBRARY)
### END CAMERA MODULE

OPENGLES_LIB  := -lGLESv1_CM
OPENGLES_DEF  := -DUSE_OPENGL_ES_1_1

LOCAL_MODULE    := NativeCamera
LOCAL_SRC_FILES := CameraRenderer.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)
LOCAL_LDLIBS += $(OPENGLES_LIB) -llog -ldl
include $(BUILD_SHARED_LIBRARY)

The java and C++ part is quite common and I don't think that could help... Thank you in advance for any help!

alvise