d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Win32 Api And Windows Gdi > I Doubt This Exists
Prev12347Next
Add Reply New Topic New Poll
Member
Posts: 31,680
Joined: Nov 10 2007
Gold: 1.00
Nov 9 2009 07:05pm
Quote (llamaoo7 @ 9 Nov 2009 20:02)
Consult your dictionary.  I'm done here.


Spamming isn't helping.

Telling somebody who asks how to change their oil, "Change your oil," isn't going to tell them anything new.
Member
Posts: 9,475
Joined: Mar 14 2005
Gold: 110.00
Nov 9 2009 07:14pm
Quote (Muted @ 9 Nov 2009 20:05)
Spamming isn't helping.

Telling somebody who asks how to change their oil, "Change your oil," isn't going to tell them anything new.


You asked (very vaguely) how do I compare two images. I responded with "just use the MD5". Your analogy is shit.

http://www.lmgtfy.com/?q=compare+file+md5+c%2B%2B
Member
Posts: 31,680
Joined: Nov 10 2007
Gold: 1.00
Nov 9 2009 07:33pm
Quote (llamaoo7 @ 9 Nov 2009 20:14)
You asked (very vaguely) how do I compare two images.  I responded with "just use the MD5".  Your analogy is shit.

http://www.lmgtfy.com/?q=compare+file+md5+c%2B%2B


I very specifically asked if the Win32 API and Window's GDI had a method of doing it.
Should wear your reading glasses more often and troll less. Thanks for the worthless effort though, was worth the +1s.
Member
Posts: 6,953
Joined: Sep 27 2003
Gold: 518.50
Nov 10 2009 12:02am
And this is why nobody likes to help you. "Compare" can mean a lot. If you just want to see if two things are different, then MD5 is great (or the simpler test of comparing if their heights and widths are the same). If you want to know HOW two things are different, then there are a million ways to do that, depending on the desired output.
Member
Posts: 31,680
Joined: Nov 10 2007
Gold: 1.00
Nov 10 2009 01:54am
If I show you an apple, and an orange, and tell you to "compare" them, I hope to God you give the expected output. If not, so God help us all.
Member
Posts: 6,953
Joined: Sep 27 2003
Gold: 518.50
Nov 10 2009 02:36am
I could compare them botanically: They are both fruit that are taken from trees.
I could compare them by shape: both round-ish, although the orange is "more round."
I could compare them by color: the apple is probably red and the orange should be orange.
I could compare them by pixels, the morph rate required to turn the apple into an orange, the amount of rotational difference between the two separate objects, the difference in my desire to eat one of them (I would prefer the apple, BTW)...I could go on all day...

Expected output matters...a lot.
Member
Posts: 31,680
Joined: Nov 10 2007
Gold: 1.00
Nov 10 2009 03:59am
Quote (ASBands @ 10 Nov 2009 03:36)
I could compare them botanically: They are both fruit that are taken from trees.
I could compare them by shape: both round-ish, although the orange is "more round."
I could compare them by color: the apple is probably red and the orange should be orange.
I could compare them by pixels, the morph rate required to turn the apple into an orange, the amount of rotational difference between the two separate objects, the difference in my desire to eat one of them (I would prefer the apple, BTW)...I could go on all day...

Expected output matters...a lot.


For once, an actual reply. Well, if you want to get that technical, this is what I wanted:
To compare it pixel per pixel.
To compare two images, one against another.
To see if they differ in any way, shape or form (colors on specific locations (EG: 1280, 1024th pixel in picture A is 0, 0, 255 versus picture B is 255, 0, 0))
Member
Posts: 6,953
Joined: Sep 27 2003
Gold: 518.50
Nov 10 2009 05:24am
Quote (Muted @ Nov 10 2009 04:59am)
For once, an actual reply. Well, if you want to get that technical, this is what I wanted:
To compare it pixel per pixel.
To compare two images, one against another.
To see if they differ in any way, shape or form (colors on specific locations (EG: 1280, 1024th pixel in picture A is 0, 0, 255 versus picture B is 255, 0, 0))

Most of the problem is in presentation. Bitmaps are basically just char* with some extra information like height and width attached to them. So if the height and width are the same, then you can do a meaningful comparison by directly iterating through them (and skipping the junk like the pitch). You can use this pixel diff information to present something nice to the user. For images of different sizes...well, it's a pain in the ass. For higher-level information (like region-of-interest mapping and other crap), I'd suggest OpenCV.
Member
Posts: 31,680
Joined: Nov 10 2007
Gold: 1.00
Nov 10 2009 05:58am
Quote (ASBands @ 10 Nov 2009 06:24)
Most of the problem is in presentation.  Bitmaps are basically just char* with some extra information like height and width attached to them.  So if the height and width are the same, then you can do a meaningful comparison by directly iterating through them (and skipping the junk like the pitch).  You can use this pixel diff information to present something nice to the user.  For images of different sizes...well, it's a pain in the ass.  For higher-level information (like region-of-interest mapping and other crap), I'd suggest OpenCV.


Which is the problem: I don't know how to iterator through a bitmap image that's in memory.
My only assumption is it has to do with GetDIBColorTable (http://msdn.microsoft.com/en-us/library/ms929232.aspx).
Member
Posts: 6,953
Joined: Sep 27 2003
Gold: 518.50
Nov 10 2009 06:35am
I would imagine GetBitmapBits (http://msdn.microsoft.com/en-us/library/dd144850(VS.85).aspx) would be more useful.
Go Back To Programming & Development Topic List
Prev12347Next
Add Reply New Topic New Poll