Software Archive
Read-only legacy content
17061 Discussions

Face Recognition Database

Septiadi_R_
Beginner
700 Views

how to save the image files (face) into the database MySQL/Oracle/SQL Server?

Please help..

0 Kudos
8 Replies
Adam_K_1
Beginner
700 Views

an answer from Intel?

0 Kudos
Stefano_A_
Beginner
700 Views

Hi,

About Oracle, you can find useful information on this link:

http://docs.oracle.com/database/121/nav/portal_7.htm

The section is:

Oracle Multimedia

Oracle Multimedia (formerly known as Oracle interMedia) lets you write applications to manage images, audio,video, and other heterogeneous media data in Oracle databases.

BR

Stefano

0 Kudos
joab_s_
Beginner
700 Views

Depend on if you want to save a picture or the information about your face I mean the buffer of recognition, I made an application where I save a picture and I save a array of bytes in the mysql as blob. if it is what you want to know tell me.

0 Kudos
Adam_K_1
Beginner
700 Views
 He wants to write: Information about the face but not the image
0 Kudos
Septiadi_R_
Beginner
700 Views

joab s. wrote:

Depend on if you want to save a picture or the information about your face I mean the buffer of recognition, I made an application where I save a picture and I save a array of bytes in the mysql as blob. if it is what you want to know tell me.

can give an example to me?

0 Kudos
joab_s_
Beginner
700 Views

I don't know if it is the best way to do that, but I did and it worked without any problem.          

I left a piece of an example how you can do it, in order to save the buffer on database your field may be longblob (in MySql) because just one register is nearly 65K I think so.

Following these steps:

1. Register User

2. Get a buffer of the user

3. change the Id

4. you can save the photo of the user if you want (I save the URL of the image on the database)

Note:  You have to make sure that there only is one person into the buffer, because when you retrieve the buffer, you are getting all the registers of the users

 

                 // Acquire the color image data
                PXCMCapture.Sample sample = senseManager.QuerySample();
                Bitmap colorBitmap;
                PXCMImage.ImageData colorData;
                sample.color.AcquireAccess(PXCMImage.Access.ACCESS_READ, PXCMImage.PixelFormat.PIXEL_FORMAT_RGB24, out colorData);
                colorBitmap = colorData.ToBitmap(0, sample.color.info.width, sample.color.info.height);
 
                 

               // Saving the image of the user
                colorBitmap.Save("user.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);

 

               // you can use this method to get buffer
               private Byte[] getDatabaseBuffer()
               {
                          PXCMFaceData.RecognitionModuleData recognitionModuleData = faceData.QueryRecognitionModule();
                          Int32 nBytes = recognitionModuleData.QueryDatabaseSize();
                         Byte[] buffer = new Byte[nBytes];
                         //Retrieve the database buffer
                        recognitionModuleData.QueryDatabaseBuffer(buffer);
                        return buffer;
               }

                          private void changeUserId(int userIdBuffer,int myUserId){
                          Byte[] buffer = getDatabaseBuffer(); //getting current buffer

                          for (int x = 0; x < buffer x++)
                            {
                                if buffer == Convert.ToByte(userIdBuffer)) //userId default example : 100
                                {
                                    buffer = Convert.ToByte(myUserId); // your Id example : 1
                                }
                            }

                   }

0 Kudos
Adam_K_1
Beginner
699 Views

Thank you for your answer.
Is it possible to save the database image not only information about face?

0 Kudos
samontab
Valued Contributor II
700 Views

Of course it is possible, it is just a common database transaction.

You could save the bits of the image as a blob, or read about storing images in your database in particular.

Or you could save the path of the image and save the image as a file as well.

Both approaches have pros and cons that will depend on your application in particular.

0 Kudos
Reply