android-camera

Front face camera android. [duplicate]

痞子三分冷 提交于 2019-12-22 00:47:44
问题 This question already has answers here : How do I open the “front camera” on the Android platform? (9 answers) Closed 2 years ago . I am developing a demo in which I have to check if device has front camera if device has front camera then I have to open it to capture a image. I searched a lot but didn't find any solution. Please help me by giving a solution. Thanks in advance. 回答1: My solution for use front face camera : private Camera openFrontFacingCameraGingerbread() { int cameraCount = 0;

Android Camera Flash Control [duplicate]

烂漫一生 提交于 2019-12-22 00:06:11
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How Turn on only Camera flash light programmatically in android? okay guys, I have been looking for a little while and I cant seem to find this anywhere, I would like to grant my camera application access to the flash bulbs or whatever you want to call them, If anyone knows and would like to share that would be greatly appreciated. Or if anyone can point me into the right direction that would be great. 回答1: I'll

Take photo when face detected

≯℡__Kan透↙ 提交于 2019-12-21 23:21:04
问题 I have the following code and i want to automatic take only one photo when a face is detected. I have achieve to automatic take photo but it takes many photos without time to process them because it continuously detect the face. How can i make it to search every x minutes to find a face or every x minutes to take photo? Thank you in advance. FaceDetectionListener faceDetectionListener = new FaceDetectionListener(){ @Override public void onFaceDetection(Face[] faces, Camera camera) { if (faces

Custom camera app in android problems - rotation 270, stretched capture view and not getting all functions

我的梦境 提交于 2019-12-21 21:37:20
问题 I got the help from code https://github.com/josnidhin/Android-Camera-Example But facing some problems like: How to add functionalities of auto focus and flash. - solved in last edited code The when screen orientation is 270 so real view shows 180 degree rotated. Capture view is showing stretched. The CODE from where i called the custom camera class Camera cam = Camera.open(); if (null == cam) { // no camera exists Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images

Why My Camera preview shows Horizontal instead of the Vertical?

核能气质少年 提交于 2019-12-21 20:37:54
问题 In My Android Camera Application if i fix the Screen to the landscape then In landscape mode it seems as it have to be seen. but if i fix it to the portrait then the Camera preview is seen to the horizontal. Why it is Happening ? and Whats the Sollution for it ?? 回答1: Camera.Parameters parameters = mCamera.getParameters(); parameters.set("orientation", "portrait"); mCamera.setParameters(parameters); You can call startPreview() after this :) 来源: https://stackoverflow.com/questions/7885873/why

Android: using OpenCV VideoCapture in service

穿精又带淫゛_ 提交于 2019-12-21 20:20:36
问题 I'm using a service that is started when the Android device boots. This is because I don't need a visible activity. Works fine so far. But now I'm trying to open the camera (in MyService.onStart) and do some basic image processing. I understood that the default Android camera class needs a surface for video preview. That's why I want to use the VideoCapture from OpenCV. But I get this error: No implementation found for native Lorg/opencv/highgui/VideoCapture;.n_VideoCapture:(I)J I'm wondering

Setting Parameters.FLASH_MODE_TORCH doesn't work on Droid X 2.3

五迷三道 提交于 2019-12-21 19:27:08
问题 I am writing an app that sets the flash mode to torch. I have been testing the application on my Droid X, and the LED light does not come on. I tried it on a Droid Incredible and it worked fine. I can't figure out what the problem is. Here is part of my code for turning on torch mode. Camera mCamera = Camera.open(); Camera.Parameters params = mCamera.getParameters(); if(params.getFlashMode() != null){ params.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH); } mCamera.setParameters(params); I

How to disable/modify AutoFocus and AutoWhiteBalance on Android Camera using OpenCV

一曲冷凌霜 提交于 2019-12-21 19:20:12
问题 I'm using Android + Opencv(new to opencv) and I'm currently working with real time object detection (the object stays really close to the android device Camera) , and I noticed that the Android camera's autoFocus keeps modifying my frames (kind of 'zoom in' and 'zoom out' effect) which make it harder for me to keep tracking the object. I need to turn the "AUTO FOCUS" off because in my case the more blurred image input I have, the better, and I also need to turn the AutoWhiteBalance off as

takePicture failed after autofocus for the second time

不羁的心 提交于 2019-12-21 18:17:08
问题 I am developing an android camera app, using autofocus. The issue, i am able to capture for the first time, but when i am trying to capture for the second time the below exception occurs. 4-19 11:28:32.509: E/AndroidRuntime(4409): FATAL EXCEPTION: main 04-19 11:28:32.509: E/AndroidRuntime(4409): java.lang.RuntimeException: takePicture failed 04-19 11:28:32.509: E/AndroidRuntime(4409): at android.hardware.Camera.native_takePicture(Native Method) 04-19 11:28:32.509: E/AndroidRuntime(4409): at

Video display is garbled when recording on Galaxy S3

半腔热情 提交于 2019-12-21 17:34:37
问题 I'm writing a camera app and am having an issue with the S3. Whenever I start recording, the display goes to garbage (see screenshots below). Then, when I stop recording I get an exception: 10-02 13:36:31.647: E/MediaRecorder(24283): stop failed: -1007 10-02 13:36:31.647: D/AndroidRuntime(24283): Shutting down VM 10-02 13:36:31.647: W/dalvikvm(24283): threadid=1: thread exiting with uncaught exception (group=0x40c49a68) 10-02 13:36:31.647: E/AndroidRuntime(24283): FATAL EXCEPTION: main 10-02