android-camera

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,

What is Uri in Android?

依然范特西╮ 提交于 2019-12-23 04:04:51
问题 This question might seem stupid but, I am writing a dissertation about camera API for Android. Right now I'm looking at saving images on a SD Card, but I'm a bit confused about what Uri is and does. Does it parse the image from the camera to the imageView? Is it the path of the image? I found a tutorial, but it doesn't describe what the Uri is. The Uri in the code Uri uri; final static int MEDIA_TYPE_IMAGE = 1; uri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); public Uri getOutputMediaFileUri

Crop an image from gallery in android

戏子无情 提交于 2019-12-23 03:18:10
问题 I want to crop an image in my application when it is selected from gallery.My cropping code work from the simulator but not properly work on phones. I set outputX=400 and outputY =487. In my simulator i get the output bitmap with 400 x 487 resolution,but when i cropped the image from phone gallery i get the output bitmap with 145 x 177 resolution. Why does it happen? My code for cropping is given below Intent intent = new Intent("com.android.camera.action.CROP"); intent.setType("image/*");

Android camera preview on SurfaceTexture

依然范特西╮ 提交于 2019-12-23 02:53:44
问题 This is my scenario: I am trying to take a picture from the front camera when someone puts in the incorrect password in the lock screen. Basically, I need to be able to take a picture out of the front cam without a preview. After much googling, I figured out that the way to do it is opengl and SurfaceTexture. You direct the camera preview to a SurfaceTexture, and later extract the picture from this texture somehow. I found this out from the following resources: https://stackoverflow.com/a

Android Front Camera recording video but plays upside down…!

浪子不回头ぞ 提交于 2019-12-23 02:39:48
问题 I have managed to create an android application to record videos but the problem is with the orientation of front camera video . The output is not the as per requirements . It gets automatically rotated . Application orientation is landscape . So, I need to record using front cam in landscape mode. Nothing is working out . 回答1: You might want to look at how the AOSP VideoCamera activity is implementing this: if (info.facing == CameraInfo.CAMERA_FACING_FRONT) { rotation = (info.orientation -

How to restrict use of third party camera app from your app

江枫思渺然 提交于 2019-12-23 02:26:08
问题 I have power cam app which is a third party camera app installed in my device. I am opening camera from my app, when i click on open camera button, it gives me choice of cameras like device camera along with power cam. I want that on clicking the open camera button, device camera should get open, in other words i want to restrict the user from using power cam from my app 回答1: If you want to run only the official camera, you can use the following intent (based on the official tutorial): static

Android camera2 speed-up

[亡魂溺海] 提交于 2019-12-23 01:36:35
问题 I need to speed-up capturing of camera2 API. I tried to build "android-Camera2Basic" project from google samples. For default capture request from example: if (null == activity || null == mCameraDevice) { return; } // This is the CaptureRequest.Builder that we use to take a picture. final CaptureRequest.Builder captureBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE); captureBuilder.addTarget(mImageReader.getSurface()); // Use the same AE and AF modes as the

How to crop video with ffmpeg library in Android?

拟墨画扇 提交于 2019-12-23 01:35:17
问题 To crop video in Android app I use ffmpeg library In SO example I found for cropping the video the following command: ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4 I created a String array: String[] cmd = {"ffmpeg", "-i", originalVideoPath, "-vf", "\"crop=" + imageWidth + ":" + imageHeight + ":" + xCoordinate + ":" + yCoordinate + "\"", "-c:a", "copy", croppedVideoPath}; And I pass this array to execute() method: try { ffmpeg = FFmpeg.getInstance(getContext()); ffmpeg.execute(cmd,

Implement indicator on tap to focus in camera [android]

醉酒当歌 提交于 2019-12-23 01:35:15
问题 I have my own camera android app which performs pinch zoom and tap to focus. In tap to focus i need to draw a rectangle or circle indicator when i touch the screen and redraw wherever i touched.One more thing i want to change the color if auto focus has done. So far i have done to draw rectangle on screen at center but i couldn't redraw it if i touched somewhere on the screen. Any idea or suggestion to implement it would be thankful My codes are @Override public void onDraw(Canvas canvas) {

Custom Android Camera Application, Camera Preview Issue

梦想的初衷 提交于 2019-12-22 18:34:06
问题 the camera preview is showing a distorted image, which is elongated while in portrait mode and flattened while in landscape. I have already resized preview with a million techniques. Then I read somewhere it must be something with resizing the SurfaceView . But so far I have not found anything suitable. This is my activity.java file: public class CameraActivity extends Activity { private Camera mCamera; private CameraPreview mPreview; private FrameLayout preview; private static final String