camera
Camera access with Xamarin.Forms
I finally created a minimum solution for iOS and Android. The shared project First, let’s look into the shared code. For an easy interaction between the shared App class and the platform-specific code we store a static Instance within the public static App: public static App Instance; Furthermore, we will display an Image, which will … Read more
Capturing video from two cameras in OpenCV at once
Using OPENCV and two standard USB cameras, I was able to do this using multithreading. Essentially, define one function which opens an opencv window and VideoCapture element. Then, create two threads with the camera ID and window name as inputs. import cv2 import threading class camThread(threading.Thread): def __init__(self, previewName, camID): threading.Thread.__init__(self) self.previewName = previewName self.camID … Read more
Access the camera with iOS
You need to use the UIImagePickerController class, basically: UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = pickerDelegate picker.sourceType = UIImagePickerControllerSourceTypeCamera The pickerDelegate object above needs to implement the following method: – (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info The dictionary info will contain entries for the original, and the edited image, keyed with UIImagePickerControllerOriginalImage and UIImagePickerControllerEditedImage respectively. (see … Read more
How to capture an image and store it with the native Android Camera
Here was the final product in case anyone is still visiting this thread: public class CameraCapture extends Activity { protected boolean _taken = true; File sdImageMainDirectory; protected static final String PHOTO_TAKEN = “photo_taken”; @Override public void onCreate(Bundle savedInstanceState) { try { super.onCreate(savedInstanceState); File root = new File(Environment .getExternalStorageDirectory() + File.separator + “myDir” + File.separator); root.mkdirs(); … Read more
Is there a good tutorial for implementing an augmented reality iPhone application? [closed]
I doubt exactly such a thing exists, but what you need to do is look at the location and camera frameworks for the iPhone, and go from there. Basically, you will create a UIImagePickerController (the Camera class) and overlay information on the view, via a custom .cameraOverlayView (which is a property of UIImagePickerController in 3.0). … Read more
How to fix “Fail to connect to camera service” exception in Android emulator
From the Android Developers Docs: Calling Camera.open() throws an exception if the camera is already in use by another application, so we wrap it in a try block. Try wrapping that code in a try catch block like so: try { releaseCameraAndPreview(); if (camId == 0) { mCamera = Camera.open(Camera.CameraInfo.CAMERA_FACING_FRONT); } else { mCamera = … Read more
How to allow Chrome to access my camera on localhost?
To ignore Chrome’s secure origin policy, follow these steps. Navigate to chrome://flags/#unsafely-treat-insecure-origin-as-secure in Chrome. Find and enable the Insecure origins treated as secure section (see below). Add any addresses you want to ignore the secure origin policy for. Remember to include the port number too (if required). Save and restart Chrome. I found solution from … Read more
Using the camera activity in Android
If you want to get the image back in its full glory, pass in a uri to the Intent within the EXTRA_OUTPUT extra. If you’re fine with a smallish bitmap (and you should be), just call the intent as normal. Now you have two options, deal with the uri of the image that is returned … Read more
Reading the GPS data from the image returned by the camera in iOS iphone
The problem is that since iOS 4 UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; strips the geolocation out. To solve this problem you have to use the original photo path to get access to the full image metadata. With something like this: – (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSURL *referenceURL = [info objectForKey:UIImagePickerControllerReferenceURL]; ALAssetsLibrary *library = [[ALAssetsLibrary … Read more