camera-view

OutOfMemoryError generated due to camera preview

限于喜欢 提交于 2021-02-04 20:47:30
问题 I managed to open the Android camera using opencv. but when i use the code that fixes the camera orientation -"see the code mentioned below in the onCameraFrame(..) method"- the App crashes after few seconds and the logcat generates the belwo posted messages in the "logcat section". To solve this issue: i tried to use SystemClock.sleep to force the App to dely for a while but this was not a good solution because it delays the camera preview i tried to minimize the frame size as much as i can,

Create cameraview (mask) on surfaceview in android

我只是一个虾纸丫 提交于 2020-01-04 17:31:55
问题 I want to create a mask on camera surface view. see image below. mask is resizable. image will be clicked only by unblurred area. can anybody give idea how to create suh mask? thanks in advance. 回答1: You can't draw on the Surface of the SurfaceView that is receiving the camera preview. You have two basic options: draw on the View part of the SurfaceView, treating it as a custom view, or create a second SurfaceView and layer it on top of the camera surface. For the latter, you would use

Create cameraview (mask) on surfaceview in android

落爺英雄遲暮 提交于 2020-01-04 17:31:01
问题 I want to create a mask on camera surface view. see image below. mask is resizable. image will be clicked only by unblurred area. can anybody give idea how to create suh mask? thanks in advance. 回答1: You can't draw on the Surface of the SurfaceView that is receiving the camera preview. You have two basic options: draw on the View part of the SurfaceView, treating it as a custom view, or create a second SurfaceView and layer it on top of the camera surface. For the latter, you would use

How to scan for QR codes on button press?

冷暖自知 提交于 2019-12-11 12:13:52
问题 I am using the code provided by https://www.hackingwithswift.com/example-code/media/how-to-scan-a-qr-code to make my own scanning app. But I like my scanning to occur on button press. Now for this I put the viewDidLoad() part from the tutorial into its own function: func cameraScanningLayer(){ view.backgroundColor = UIColor.blackColor() captureSession = AVCaptureSession() let videoCaptureDevice = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeVideo) let videoInput: AVCaptureDeviceInput

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();

How to capture image from custom CameraView in Android?

我与影子孤独终老i 提交于 2019-11-26 11:56:51
问题 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 ? 回答1: 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