1

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.

Kevin Whitefoot
  • 414
  • 3
  • 15

1 Answers1

0

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.

graphite
  • 2,920
  • 22
  • 40
  • Not really suitable for this app because I can't expect people to install Python on their mobile. I've discovered now that QPainter has composition modes including XOR (QPainter::RasterOp_SourceXorDestination) so I'll investigate that: [link]http://doc.qt.digia.com/qt/qpainter.html#CompositionMode-enum – Kevin Whitefoot Oct 26 '12 at 11:51