comparing bitmaps?

Login to reply to this topic.
Tue, 2008-01-29 04:07
Joined: 2007-11-02
Forum posts: 37

Hi,
I need to compare between 2 image bitmaps pixel by pixel:-
1. to find exact match
2. to find an approximate match

I searhced the sdk and could not find any apis for this.
Are there any apis for this?
How to do it?


Tue, 2008-01-29 10:06
Joined: 2004-11-29
Forum posts: 1134
Re: comparing bitmaps?

There is no api:s for it.
That is, no such thing as "CompareBitmaps" or such.

Exact match is pretty simple to do though, but "approximate match" could be much tricker and how tricky depends a lot on how you define "approximate".
Will you just check that the image is pixel by pixel approximately the same color? (also pretty simple, just need knowledge of pixel formats)
Or do you want to find if a particular shape in image 1 is also present in image 2? (a little more tricky)
Do you want to compare photos? (really tricky)

In any case you will need to look up on how to do low level access to bitmaps (LockHeap, DataAddress, DataStride, UnlockHeap on the CFbsBitmap).
For the exact "pixel-by-pixel match" and "approximate color pixel-by-pixel match" you just then need a for loop going through the image and comparing pixels and return false when fails to match.
For the more advanced "approximate" you most probably will need some kind of image processing library, and lots of time to get it to work (if you've never done anything like it before)

Thu, 2008-02-21 14:08
Joined: 2007-04-10
Forum posts: 17
Re: comparing bitmaps?

But, what do you mean "approximate match", perhaps yuo could try to read some Image Processing tutorials and implemented to Symbian.

  • Login to reply to this topic.