Click here to Skip to main content
16,012,468 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi
Sorry if my question is wrong . I'm newbie in Image-processing programming and I didn't work by any Databases . but I know a little about Database concepts and SQL language .

More , I want a Database that I could store images , processing on them or comparing them with a base image and something like that .

I use Ubuntu Linux and c++ language for programming and Code::Blocks IDE .
Posted

C#
 1.public static bool ImageCompareString(Bitmap firstImage, Bitmap secondImage)
 2: {
 3:     MemoryStream ms = new MemoryStream();
 4:     firstImage.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
 5:     String firstBitmap = Convert.ToBase64String(ms.ToArray());
 6:     ms.Position = 0;
 7:
 8:     secondImage.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
 9:     String secondBitmap = Convert.ToBase64String(ms.ToArray());
10:
11:     if (firstBitmap.Equals(secondBitmap))
12:     {
13:         return true;
14:     }
15:     else
16:     {
17:         return false;
18:     }
19: }
 
Share this answer
 
Comments
nv3 25-Jul-13 7:57am    
First of all this is C# code and no C++. Then, this rather primitive function only finds the images as equal if they compare bit-by-bit, which is not what most people would look for. Then you could reduce the last 8 lines of your function to a single one:
return firstBitmap.Equals (secondBitmap);
And lastly, this does not answer the OP's question about what database he should use for storing images.
Chui PuiKwan 25-Jul-13 8:24am    
even through it's primitive way,but it's a way.
code languages is different,but the minds is same.

another way:

1.height and width
2.filesie
3.take 100 or 1000 points randomly,Getpixel
4. .....

if you want to select a database,I firstly advise that you should store image in a directory .

Importantly,you requirements decide which database should be selected.
I list some databases,as follows:

sqllite,smaller
mysql;opensource
ms sql;
oracle:
db2:
infomix:
hor_313 25-Jul-13 8:33am    
what about postgreSQL ?
Chui PuiKwan 25-Jul-13 8:49am    
http://www-css.fnal.gov/dsg/external/freeware/mysql-vs-pgsql.html

http://dcdb.cern.ch/dcdb/archive/ttraczyk/db_compare/db_compare.html

if your server is linux,you can adopt mysql or oracle.
I advise mysql firstly.
You better divide database and image storage.
Create a database which hold the infos about the image and other stuff and last but not least has also a relative path to the image.

The image are in a special folder, but the name must be unique. use somethin like: pic<recorrd-id> for the name.

For processing load the pics and do the stuff ;-)
 
Share this answer
 
Comments
nv3 25-Jul-13 7:58am    
My 5. I also would keep database and image processing apart and use a database as storage medium for images only, when absolutely necessary.
KarstenK 25-Jul-13 8:04am    
saving BLOB in a database is Harakiri ;-)
hor_313 25-Jul-13 8:17am    
BLOB ?
KarstenK 25-Jul-13 8:23am    
The horror of every programmer:
http://en.wikipedia.org/wiki/The_Blob
http://en.wikipedia.org/wiki/BLOB

;-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900