Motion Sensing by Camera in iOS

前端 未结 2 1117
自闭症患者
自闭症患者 2020-12-16 06:14

I am working on an app in iOS that will occur an event if camera detects some changes in image or we can say motion in image. Here I am not asking about face recognition o

相关标签:
2条回答
  • 2020-12-16 06:50

    If all you want is some kind of crude motion detection, my open source GPUImage framework has a GPUImageMotionDetector within it.

    This admittedly simple motion detector does frame-to-frame comparisons, based on a low-pass filter, and can identify the number of pixels that have changed between frames and the centroid of the changed area. It operates on live video and I know some people who've used it for motion activation of functions in their iOS applications.

    Because it relies on pixel differences and not optical flow or feature matching, it can be prone to false positives and can't track discrete objects as they move in a frame. However, if all you need is basic motion sensing, this is pretty easy to drop into your application. Look at the FilterShowcase example to see how it works in practice.

    0 讨论(0)
  • 2020-12-16 06:51

    I don't exactly understand what you mean here:

    Here I am not asking about face recognition or a particular colored image motion, because I got all result for OpenCV when I searched

    But I would suggest to go for opencv as you can use opencv in IOS. Here is a good link which helps you to setup opencv in ios.

    There are lot of opencv motion detection codes online and here is one among them, which you can make use of.

    You need to convert the UIImage ( image type in IOS ) to cv::Mat or IplImage and pass it to the opencv algorithms. You can convert using this link or this.

    0 讨论(0)
提交回复
热议问题