开发者

How to capture a motion in iphone camera

开发者 https://www.devze.com 2022-12-27 11:08 出处:网络
In My application as the user opens the camera,camera should capture a image as soon as there is a difference in image when compared to previous image and camera should always be in capturing mode.

In My application as the user opens the camera, camera should capture a image as soon as there is a difference in image when compared to previous image and camera should always be in capturing mode.

This should be done automatically without any 开发者_如何学运维user interaction.Please Help me out as i couldn't find the solution asap.

Thanks, ravi


I don't think the iPhone camera can do what you want.

It sounds like your doing a type of motion detection by comparing two snapshots taken at different times and seeing if something has changed between the older and the newer image. To that you need:

I don't think the iPhone can do what you want. The camera is not setup to automatically take photos and I don't think the hardware can support the level of processing needed to compare two images in enough detail to detect motion.

Hmmmm, in thinking about it, you might be able to detect motion by somehow measuring the frame differentials in the compression of video. All the video codecs save space by only registering the parts of the video that change from frame-to-frame. So, a large change in the saved data would indicate a large change in the environment.

I have no idea how to go about doing that but it might give you a starting point.


You could try using opencv for motion detection based on differences between captured frames but I'm not sure if the iPhone API allows reading multiple frames from the camera.

Look for motempl.c in the opencv distribution.


You can do a screenshot to automatically capture the image, using the UIGetScreenImage function.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号