android-camera2

Adding ARToolkit Marker tracking into Tango

时光毁灭记忆、已成空白 提交于 2019-12-23 04:18:07
问题 I have been trying to integrate ARToolkit Marker Object tracking into a Tango Application . So far I have created a build so that a tango app can access and use the ARToolkit Native Library or the ARToolkit Unity wrappers. However, they both seem to require exclusive access to the camera in their default configurations. How could you feed the same Android video feed to both libraries? Could you create a dummy camera device which doubles out the feed? Could you take the tango feed as normal,

camera2 pictures taken are blurred

孤者浪人 提交于 2019-12-23 02:59:24
问题 I'm experiencing a bad behavior when capturing a photo on a Samsung Galaxy S7 edge device. I wait simultaneously for focus and exposure before taking the picture but at the end I have a kind of blurred image compared to the native camera app output. The problem is especially visible on zoomed images but is present also when not zoomed. I've also tried to enable the optical image stabilization but the problem isn't fixed. Below are linked sample images explaining the problem. Native camera

How to save images with correct orientation using CAMERA2

混江龙づ霸主 提交于 2019-12-23 02:36:34
问题 Here is my camera fragment, in which I am opening the camera using TextureView . The camera is capturing the image in correct orientation but the captured image is not getting saved in correct orientation... public class Camera2BasicFragment extends Fragment implements View.OnClickListener, FragmentCompat.OnRequestPermissionsResultCallback { private static final SparseIntArray ORIENTATIONS = new SparseIntArray(); private static final int REQUEST_CAMERA_PERMISSION = 1; private static final

Android Camera2 Video Playback Video and Audio Out of Sync

不羁岁月 提交于 2019-12-23 02:36:07
问题 I've been having an issue using the camera 2 api for android. I'm able to record videos, but during playback, only the audio plays. After the video is done playing, the time jumps ahead anywhere from 10 minutes to 2 hours and then plays the video back. I've never heard of an issue like this. I pretty much followed this. Here is the code for setting my media recorder: mMediaRecorder = new MediaRecorder(); // Step 2: Set sources mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER)

Incorrect transformation of frames from YUV_420_888 format to NV21 within an image reader

微笑、不失礼 提交于 2019-12-22 10:23:36
问题 I configured my code in order to get a stream of YUV_420_888 frames from my device's camera using an imageReader object and the rest of the well known camera2 API. Now I need to transform these frames to NV21 pixel format and call a native function which expect a frame in this format to perform certain computations. This is the code I am using inside the imagereader callback to rearrange the bytes of the frame: ImageReader.OnImageAvailableListener readerListener = new ImageReader

Why is Android's ImageReader class so slow?

假装没事ソ 提交于 2019-12-22 10:07:28
问题 I tried OpenCV for Android 3.4.1's brand new JavaCamera2View but it was too slow(~15fps for just showing camera view). When I tried the older JavaCameraView instead, it gave me good results(~30fps, which is the limit of my camera). I wondered the reason why Camera2 version was so slow and looked into the implementation. I commented out all processings and renderings of the image (just letting the camera draw to internal ImageReader object and then reading it off using acquireLastImage()

How to use a reprocessCaptureRequest with camera2 API

旧城冷巷雨未停 提交于 2019-12-21 05:33:10
问题 I'm trying to update a camera project to Android N and in consequence I'm moving my old CameraCaptureSession to a ReprocessableCaptureSession. I did it and it is working fine, but with this new feature I can use the CameraDevice.TEMPLATE_ZERO_SHUTTER_LAG template in my device and I can reprocess frames with the reprocessCaptureRequest. Here is where my problem appear. Because I don't find any example, and I don't really understand the little documentation about how to use a

How to get an Android Camera2 with 1:1 ratio like Instagram?

筅森魡賤 提交于 2019-12-21 03:43:46
问题 My question is very simple: How to get an Android android.hardware.Camera2 with 1:1 ratio and without deformation like Instagram? I tested with the GoogeSamples project android-Camera2Basic. But when I change the preview with a ratio of 1:1 image is deformed. Does anyone have an idea on this? 回答1: Thanks @CommonsWare. I followed your advice using negative margin (top and bottom) and it works. To do that, I just update AutoFitTextureView the GoogeSamples project android-Camera2Basic this way:

Close CameraDevice in a seperate thread

為{幸葍}努か 提交于 2019-12-20 05:40:28
问题 I am using Android camera2 to create a custom camera. The cameraDevice.close() method is slow and it makes UI freeze for 1 sec. I put it in another thread and it seems to work just fine. I want to know if this will cause some serious problem and whether there is another way to achieve this. Here is my closeCamera method: private void closeCamera() { boolean release = false; try { mCameraOpenCloseLock.acquire(); release = true; } catch (InterruptedException e) { release = false; } try {

Searching focus keeps failing with external lens, camera2 api in android

烈酒焚心 提交于 2019-12-20 04:38:30
问题 I am using camera2 api for my custom camera. I implemented touch to focus. It is working fine. But when I'm trying to attach external lens, it can't find focus distance, I have to try several times. Native camera works perfectly even with the lens. What else should I consider? Any opinions? please guide. 回答1: (For the further usage) I ended up the solution using samsung camera sdk. It is working perfectly 来源: https://stackoverflow.com/questions/42090124/searching-focus-keeps-failing-with