PDA

View Full Version : pattern [image] matching



rachana
26th February 2007, 13:59
Hi all,

I am implmenting puzzle application & I have basic shapes written using the QGraphicsItem (like square, parallelogram,circle,triangle etc). User will starts
arranging the items in order to meet the target puzzle which I have drawn in
the side using QImage.

Is there any way using which I can compare the QGraphicItems and target pattern
and see whether its arranged properly?

Can some body explain how to do it?

Thanks in advance,
Rachana

wysota
26th February 2007, 14:31
You want to compare a set of graphics items with a QImage? A trivial approach would be to render the scene to an image and compare pixel by pixel. If enough pixels match, you can assume the order is fine. But this way may fail very easily. The proper way to do it would be to apply image recognition techniques - edge detecting and segmentation. Then you can assemble the order and compare with the order of items.