image-capture

How to capture the image and save it in sd card

吃可爱长大的小学妹 提交于 2019-11-28 09:34:00
hey guys i am using the following code to access camera from my application. The application is able to access the camera i have also added a button whose onclicklistener adds this line of code :- camera.takePicture(mShutterCallback, mPictureCallbackRaw, mPictureCallbackJpeg); Now i dont know what happens but the application gets stuck i have to force close it and then i can not even access the native camera application. I think it leaves the application without releasing the Camera object. Plus the image never gets saved. Code :- SurfaceHolder holder; SurfaceView surface; Camera camera;

Why does AVCaptureVideoOrientation landscape modes result in upside down still images?

孤者浪人 提交于 2019-11-28 07:49:32
I am using AVFoundation classes to implement a custom camera in my app. I am only capturing still images, not video. I have everything working but am stumped by something. I take into account the device orientation when a still image is captured and set the videoOrientation of the video connection appropriately. A code snippet: // set the videoOrientation based on the device orientation to // ensure the pic is right side up for all orientations AVCaptureVideoOrientation videoOrientation; switch ([UIDevice currentDevice].orientation) { case UIDeviceOrientationLandscapeLeft: // Not clear why but

How to get Image Object using Cordova?

北战南征 提交于 2019-11-28 01:49:32
问题 When use use getPicture either we get a relative URL or base64image. But I want to send a image object to Amazon S3. Anyway to do that ? Here is how I am getting the base64image // A button will call this function // function capturePhoto() { // Take picture using device camera and retrieve image as base64-encoded string navigator.camera.getPicture(onPhotoDataSuccess, onFail, { destinationType: Camera.DestinationType.DATA_URL, quality: 50 }); } [UPDATE] Now I need to get the image as object

Null pointer after capturing image using android camera

依然范特西╮ 提交于 2019-11-27 23:40:39
in my application,i am using android devices camera to capture an image. for some devices it works fine but some are not. I just tested it on LG nexus 4 E960, after i captured the image my application went crash without able to save the result. this is my code: //Using intent to open camera Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent,CAMERA_CAPTURE); in the activityResult : protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(resultCode==RESULT_OK) { if(requestCode==CAMERA_CAPTURE) { Bitmap pictTaken = null ; Bundle

when take photo get - java.lang.Throwable: file:// Uri exposed through ClipData.Item.getUri()

て烟熏妆下的殇ゞ 提交于 2019-11-27 20:06:00
The Exception is: file:// Uri exposed through ClipData.Item.getUri() java.lang.Throwable: file:// Uri exposed through ClipData.Item.getUri() at android.os.StrictMode.onFileUriExposed(StrictMode.java:1618) at android.net.Uri.checkFileUriExposed(Uri.java:2341) at android.content.ClipData.prepareToLeaveProcess(ClipData.java:808) at android.content.Intent.prepareToLeaveProcess(Intent.java:7926) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1506) at android.app.Activity.startActivityForResult(Activity.java:3832) at android.app.Activity.startActivityForResult(Activity.java

How do I read pixels from a PNG file?

随声附和 提交于 2019-11-27 14:27:00
I know how to capture a screenshot by using Robot, Windowtester or FEST. I also know how to read a pixel from the screen by using robot. int x = 10; int y = 10; Color px = getPixelColor(int x, int y); However, I don't know how to read a pixel from an image that is already captured. I'm planning to compare a current image, with an image from file. Lets say both are PNG. Are there any frameworks that I can use to compare images pixel by pixel? hughes Is this in Java? If so, you can use ImageIO.read( "yourImage.png" ) to get a BufferedImage . That will have a getData() method which will give you

Capturing a single image from my webcam in Java or Python

自闭症网瘾萝莉.ら 提交于 2019-11-27 09:59:31
问题 I want to capture a single image from my webcam and save it to disk. I want to do this in Java or Python (preferably Java). I want something that will work on both 64-bit Win7 and 32-bit Linux. EDIT: I use Python 3.x, not 2.x Because everywhere else I see this question asked people manage to get confused, I'm going to state a few things explicitly: I do not want to use Processing I do not want to use any language other than those stated above I do want to display this image on my screen in

How to capture image from custom CameraView in Android?

我的未来我决定 提交于 2019-11-27 06:19:29
i need to capture image from required portion of the screen . capture image from camera . at that time other screen content as it is . how is this possible ? try to use Surface View for creating dynamic camera view and set in your required portion. following code try variables set Class level (Global) Button btn_capture; Camera camera1; SurfaceView surfaceView; SurfaceHolder surfaceHolder; public static boolean previewing = false; Following code in onCreate() method getWindow().setFormat(PixelFormat.UNKNOWN); surfaceView = new SurfaceView(this); surfaceHolder = surfaceView.getHolder();

Null pointer after capturing image using android camera

不问归期 提交于 2019-11-27 04:41:17
问题 in my application,i am using android devices camera to capture an image. for some devices it works fine but some are not. I just tested it on LG nexus 4 E960, after i captured the image my application went crash without able to save the result. this is my code: //Using intent to open camera Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent,CAMERA_CAPTURE); in the activityResult : protected void onActivityResult(int requestCode, int resultCode, Intent

java.lang.OutOfMemoryError - BitmapFactory.decode(strPath)

不想你离开。 提交于 2019-11-27 03:12:32
I am getting java.lang.OutOfMemoryError , whenever i am calling UploadActivity.java Line Number 176 is: Bitmap bm = BitmapFactory.decodeFile(strPath); View my Log: 12-07 17:57:10.585: E/AndroidRuntime(16708): FATAL EXCEPTION: main 12-07 17:57:10.585: E/AndroidRuntime(16708): java.lang.OutOfMemoryError 12-07 17:57:10.585: E/AndroidRuntime(16708): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) 12-07 17:57:10.585: E/AndroidRuntime(16708): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:650) 12-07 17:57:10.585: E/AndroidRuntime(16708): at android.graphics