Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone camerOverlay for use with Alternate Reality applications

Does anyone know a way to take an image captured on the iphone's camera, and do some image processing (e.g. edge detection, skeletization), and then overlay parts of the processed image on the original image (e.g. only the highlighted edges).

More generically how do I create a UImage with transparency (do I just scale the image and overlay it with an alpha value, does UIImage support transparency like gifs do). I'm thinking that you could combine a UIImagePickerController with a background thread that takes "screenshots" of the UIImagePickerController view and does image processing on it to detect various objects and provide an overlay augmented reality display.

There's an open source simple image processing library for the iphone. The demo shows an example of taking an original photo (of a sudoku board) and then overlaying the detected object in the original photo.

They explain some of the high-level techniques on their blog .

like image 204
Dougnukem Avatar asked Jul 29 '09 20:07

Dougnukem


People also ask

Does iPhone camera have augmented reality?

And support for AR is built directly into iOS and iPadOS, so you can experience AR not only from an app but also within Safari, Mail, Messages, Files and more using AR Quick Look.

How can a camera be used in augmented reality?

Augmented reality starts with a camera-equipped device—such as a smartphone, a tablet, or smart glasses—loaded with AR software. When a user points the device and looks at an object, the software recognizes it through computer vision technology, which analyzes the video stream.


2 Answers

OpenCV makes image overlays remarkably simple, and it's been ported to the iPhone. With OpenCV you can choose to take screenshots as you considered or do image processing on a live stream, one frame at a time. Take a look at some of its tutorial programs, they're really helpful.

like image 87
bkritzer Avatar answered Oct 13 '22 00:10

bkritzer


There's an UIImagePickerController.overlayView property you might want to set:

// Create a new image picker instance:
UIImagePickerController *picker = [[UIImagePickerController alloc] init];

// Set the image picker source:
picker.sourceType = UIImagePickerControllerSourceTypeCamera;

// Hide the controls:
picker.showsCameraControls = NO;
picker.navigationBarHidden = YES;

// Make camera view full screen:
picker.wantsFullScreenLayout = YES;
picker.cameraViewTransform = CGAffineTransformScale(picker.cameraViewTransform, 1, 1.12412);

// Create an overlay view
// this might need to either 1) be transparent, or 2) be of the other dimensions
OverlayView *overlay = [[OverlayView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height)];

// Insert the overlay:
picker.cameraOverlayView = overlay;
like image 42
Linas Valiukas Avatar answered Oct 13 '22 00:10

Linas Valiukas