android-camera

Android camera onpreviewframe callback and rotation sensor callback synchronization

这一生的挚爱 提交于 2020-01-04 05:38:05
问题 I have been developing an android app which requires camera preview data for each frames,with addition to that I want pitch (Angle) values (From Rotation sensor) while capturing frame.I want to map the pitch values while capturing frames in real time, for now ,I have been mapping the pitch values in onpreviewframe, but I am not getting the correct results because of delay due to frame getting delivered to onpreviewframe callback. I have registered the previewcallbackwithbuffer callback to get

ImageView setImageBitmap not working on certain devices

独自空忆成欢 提交于 2020-01-03 12:34:12
问题 I was practicing around with the Camera API for which I did the following: a. Setup a directory for the image captured (for startActivityForResult ) b. Setup the Bitmap so that the image could be shown once saved in the app itself. Here's the code for the following: Setting up the directory. private static File getOutputMediaFile(int type) { // External sdcard location File mediaStorageDir = new File( Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), IMAGE

Saving Camera Bitmap to Storage, and Setting Image with Bitmap

我的梦境 提交于 2020-01-03 04:32:09
问题 I know the basics on how to take a picture and set it to ImageView. photo = (Bitmap) data.getExtras().get("data"); imageView.setImageBitmap(photo); I want to do a little more than that. I am saving it to a folder on to an SD card. That I have done successfully with this: // intent Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file)); startActivityForResult(intent, CAMERA_REQUEST); Here is my next question: Not sure how to do

Modify camera preview with effects using GLsurfaceview

断了今生、忘了曾经 提交于 2020-01-03 02:51:09
问题 I have creating a custom camera app, I am using GLsurfaceview , GLSurfaceview.Renderer for creating camera preview. I have successfully completed it, now am trying to apply filters (sepia mode, blank n white etc) on camera preview. How can I apply effects on camera preview. normal view filter applied And this is my GLSurfaceView.Renderer public class MainRenderer implements GLSurfaceView.Renderer,SurfaceTexture.OnFrameAvailableListener{ private final String vss = "attribute vec2 vPosition;\n"

How to capture low resolution picture using android camera

大兔子大兔子 提交于 2020-01-02 07:25:23
问题 I want to capture photo and also save it to my sdcard using android camera.I know its easy but I want to store image in low resolution without telling user go to setting and set low resolution manually. 回答1: What i am gonna write is not good practice to do code but it may full-fill your requirement capture image as you do with normally using android default camera . check the path of that image which just now captured . reduce quality of that image as per requirement using BitmapFactory

Camera Preview and OCR

心不动则不痛 提交于 2020-01-02 04:35:10
问题 I am new to android development - I'm using Xamarin. I am trying to write an application that initiates the camera preview, and then constantly scans the incoming frames for text (I am using Xamarin.Tesseract from NuGet). In other words, I don't want to make the user take a photo and then do the OCR analysis, instead I want them to just point the video camera at some paper with text on it, i'll continually do the OCR analysis until I detect the specific text I'm searching for) at which point

How can i use burst camera mode of new android phones in my app?

半世苍凉 提交于 2020-01-02 04:29:05
问题 It seems a lot of new android phones have this burst mode feature for their camera and they use it in their native camera apps. I was wondering if there is an api that they use in their apps or maybe they are just taking photos in a loop, i couldn't be sure, so can anyone care to explain? 回答1: There's no official API for it, but before you go ahead and start looping .takePicture(), you should probably be calling it again on a picture callback to avoid taking up the entire CPU if there's a

setPreviewDisplay vs setPreviewTexture

故事扮演 提交于 2020-01-02 01:09:08
问题 When opening the Android camera, either a SurfaceHolder or an OpenGL SurfaceTexture must be set to hold the displayed images, using setPreviewDisplay() (API level 1) or setPreviewTexture() (API level 11), respectively. Is there any difference in speed, device compatibility (aside from API level), or image quality between the two? 回答1: Whenever you use SurfaceView to open camera, you can see a little lag and blink in screen. This is because, SurfaceView creates a new separate window where in

Android - Switch Between front and back camera

大城市里の小女人 提交于 2020-01-01 19:47:09
问题 I want to add a button to switch between front and back camera mCamera = new VideoCapture(Highgui.CV_CAP_ANDROID);//add + 1 to use front camera As shown in above code segment I can change camera by simply adding +1 . Example : mCamera = new VideoCapture(Highgui.CV_CAP_ANDROID + 1) But I want to do this by using a button. How can I implement this Thank you, private static final String TAG = "Sample::SurfaceView"; private SurfaceHolder mHolder; private VideoCapture mCamera; private FpsMeter

Android App to Send Images Via Email

三世轮回 提交于 2020-01-01 19:12:07
问题 Ok once again, I am in way over my head here while learning android. After finally developing my simple little app, I am trying to use some of the benefits of having a native app. So, project one, make a page which can send images via email (either from the gallery or camera) Essentially its a select and send via email, but I don't even know where to start. I found some code that somebody else was asking about at; Android App Take/ Email Photo I tried this, but get all sorts of errors from