Kevin Whitefoot
Kevin Whitefoot

Reputation: 442

Is there an easy (and not too slow) way to compare two images in Qt/QML to detect motion

I would like to implement a motion detecting camera in Qt/QML for Nokia N9. I hoped that there would be some built in methods for computing image differences but I can't find any in the Qt documentation.

My first thoughts were to downscale two consecutive images, convert to one bit per pixel, compute XOR, and then count the black and white pixels.

Or is there an easy way of using a library from somewhere else to achieve the same end?

Edit: I've just found some example code on the Qt developer network that looks promising: Image Composition Example.

Upvotes: 1

Views: 902

Answers (1)

graphite
graphite

Reputation: 2958

To compare images qt has QImage::operator==(const QImage&). But i don't think it will work for motion detection.

But this may help: Python Motion Detection Library + Demo.

Upvotes: 0

Related Questions