camera

Taking photo with custom camera iOS 11.0 Swift 4. Update error

泪湿孤枕 提交于 2020-07-02 07:12:21
问题 I have a custom camera in my app and it worked fine, but after the new update I am getting this error: 'jpegPhotoDataRepresentation(forJPEGSampleBuffer:previewPhotoSampleBuffer:)' was deprecated in iOS 11.0: Use -[AVCapturePhoto fileDataRepresentation] instead. This is the line where I'm getting that error: guard let imageData = AVCapturePhotoOutput.jpegPhotoDataRepresentation(forJPEGSampleBuffer: photoSampleBuffer, previewPhotoSampleBuffer: previewPhotoSampleBuffer) else { return } This is

Taking photo with custom camera iOS 11.0 Swift 4. Update error

我们两清 提交于 2020-07-02 07:12:11
问题 I have a custom camera in my app and it worked fine, but after the new update I am getting this error: 'jpegPhotoDataRepresentation(forJPEGSampleBuffer:previewPhotoSampleBuffer:)' was deprecated in iOS 11.0: Use -[AVCapturePhoto fileDataRepresentation] instead. This is the line where I'm getting that error: guard let imageData = AVCapturePhotoOutput.jpegPhotoDataRepresentation(forJPEGSampleBuffer: photoSampleBuffer, previewPhotoSampleBuffer: previewPhotoSampleBuffer) else { return } This is

Maximize zoom distance to fit 2 objects

被刻印的时光 ゝ 提交于 2020-06-28 00:18:29
问题 Objective: Move the camera position ONLY on the Z axis so the frustrum fit 2 objects. Conditions: One of the objects will be allways aligned with the camera X position Camera is set on perspective mode , not ortographic. the 2 spheres have no parent The result seen in ortographic mode from top-view should look like this: What I've done so far: Using trigonometry this can be seen it as: Knowing that, the objective is to find the Adjacent side, which will be the distance between the camera and

Flutter Camera Preview not rotating with phone orientation

不想你离开。 提交于 2020-06-11 17:19:16
问题 I'm new to Dart/Flutter and currently using the Flutter Camera Plugin but I am running into a problem with the CameraPreview for when the phone turns to landscape mode. The images stay vertical and don't rotate the 90degrees with the phone. I have tried countless things including Transform.rotate(), but I can't seem to get the image to both, fill the screen and rotate 90degrees. The pictures that were taken while the phone was sideways still saved in the correct orientation when I view them,

Why is Yp Cb Cr image buffer all shuffled in iOS 13?

不想你离开。 提交于 2020-06-11 09:03:20
问题 I have a computer vision app that takes grayscale images from sensor and processes them. The image acquisition for iOS is written in Obj-C and the image processing is performed in C++ using OpenCV. As I only need the luminance data, I acquire the image in YUV (or Yp Cb Cr) 420 bi-planar full range format and just assign the buffer's data to an OpenCV Mat object (see aquisition code below). This worked great so far, until the brand new iOS 13 came out... For some reason, on iOS 13 the image I

Why is Yp Cb Cr image buffer all shuffled in iOS 13?

偶尔善良 提交于 2020-06-11 09:03:11
问题 I have a computer vision app that takes grayscale images from sensor and processes them. The image acquisition for iOS is written in Obj-C and the image processing is performed in C++ using OpenCV. As I only need the luminance data, I acquire the image in YUV (or Yp Cb Cr) 420 bi-planar full range format and just assign the buffer's data to an OpenCV Mat object (see aquisition code below). This worked great so far, until the brand new iOS 13 came out... For some reason, on iOS 13 the image I

UIImagePickerController how to do animated switch from rear to front camera?

旧巷老猫 提交于 2020-06-10 07:27:49
问题 I have been using custom overlay for UIImagePickerController controller, and everything is working fine. I have added button to switch between front and rear camera via - - (IBAction)changeCamera:(id)sender { if (self.imagePicker.cameraDevice == UIImagePickerControllerCameraDeviceRear) { self.imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceFront; } else { self.imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceRear; } } Problem is, switch is not animated. I have been

Turning on/off flash with Android camera2 API not working

折月煮酒 提交于 2020-06-10 05:19:58
问题 I'm creating an Android app with a custom camera and I'm switching to the new camera2 API. I have a button allowing to turn ON and OFF the flash when the back camera is on (without stopping the camera, like any classic camera app). When I tap the flash icon, nothing happens and this is what the logcat returns: D/ViewRootImpl: ViewPostImeInputStage processPointer 0 D/ViewRootImpl: ViewPostImeInputStage processPointer 1 I don't know why it's not working. Here is the code: I have a

Python create image with new camera position

二次信任 提交于 2020-05-29 06:57:32
问题 I'm struggling with a specific computer vision task right now. Imagine we have a camera frame of a road for example. Now I want to generate a new frame with the imaginary camera translated horizontally. In addition, there's also a tiny camera angle added. To illustrate this, I uploaded a demonstration image: How can I create the new frame out of the original one in python? For my other computer vision tasks I was using OpenCV already. 回答1: I was struggling with this for a while too until I

Python create image with new camera position

三世轮回 提交于 2020-05-29 06:55:13
问题 I'm struggling with a specific computer vision task right now. Imagine we have a camera frame of a road for example. Now I want to generate a new frame with the imaginary camera translated horizontally. In addition, there's also a tiny camera angle added. To illustrate this, I uploaded a demonstration image: How can I create the new frame out of the original one in python? For my other computer vision tasks I was using OpenCV already. 回答1: I was struggling with this for a while too until I