How to automatically capture images as user moves down the iphone /ipad camera to make a panoroma like picture?

388 Views Asked by At

I have an app where i scan the forms means i take its pictures and upload them . Now if the form is long so that the iphone /ipad camera could not take picture of entire form clearly. In that case i want the user to slowly move the camera down , so that continous images are taken until the whole form is looked or scanned . After that create a picture stitching all the frames together. I know there can be various ways of doing this manually like i can let user chose when to take pictures ad after merge them together.

But is there any way to do this automatically maybe some api etc. I mean automatically capture frames as user moves the camera down. After that i can merge the images together .

1

There are 1 best solutions below

8
On BEST ANSWER

I think you should capture video (the UIImagePickerController gives you a quick generic interface for this), then use MPMoviePlayerController to get images from the captured video.

MPMoviePlayerController provides requestThumbnailImagesAtTimes:timeOption:.

So...

  1. write down the start time start = [NSDate date];
  2. ask the user to pan over the document and to press the stop button when done (you can put some instruction right on the preview view using the cameraOverlayView property
  3. bring up the picker and startVideoCapture
  4. when imagePickerController:didFinishPickingMediaWithInfo: gets fired, write down the end time.

  5. then, based on the interval between start and end, pick N times for images

  6. build an MPMoviePlayerController and call requestThumbnailImagesAtTimes:timeOption:

You'll have N images to stitch.