Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

WPF Face Recognition error.

Hermawan_R_
Beginner
1,412 Views

in my code for saving the recognition file, the "nbytes" variable always return null value. but when I try to develop in winform, it runs no error. and this is the part of my code. 

private void registerButton_Click(object sender, RoutedEventArgs e)
        {
            faceData = face.CreateOutput();
            faceData.Update();
            var numOfFaceDetected = faceData.QueryNumberOfDetectedFaces();
            if (faceData.QueryNumberOfDetectedFaces() <= 0)
                return;
            PXCMFaceData.Face qface = faceData.QueryFaceByIndex(0);
            if (qface == null)
            {
                throw new Exception("PXCMFaceData.Face null");
            }
            PXCMFaceData.RecognitionData rdata = qface.QueryRecognition();
            if (rdata == null)
            {
                throw new Exception(" PXCMFaceData.RecognitionData null");
            }

            PXCMFaceData.RecognitionModuleData rmd = faceData.QueryRecognitionModule();
            Int32 nbytes = rmd.QueryDatabaseSize();
            Byte[] buffer = new Byte[nbytes];
            rmd.QueryDatabaseBuffer(buffer);
            File.WriteAllBytes("text.txt", buffer);

            rdata.RegisterUser();
            id++;
            AddDatabase(id);
            
            faceData.Dispose();
        }

 

I check the value of numOfFaceDetected return the right number of face detected. But, when I try to get the nbytes values, it returns null. But when I check in debug mode rmd.QueryDatabaseSize(); has unique value. Any solution? thanks

0 Kudos
7 Replies
Xusheng_L_Intel
Employee
1,412 Views

This is known issue and we will fix it in the future release. Thanks for supporting RealSense SDK.

0 Kudos
Thoriq_S_
Beginner
1,412 Views

i think you can save a serialized data to be *.dat file instead of saving it into txt file :D

0 Kudos
Thoriq_S_
Beginner
1,412 Views

oh, i suggest you to develop your apps in windows form. i have developed a WPF apps and i got unknown error, but when i develop it in windows form, using same algorithm, i had no error

0 Kudos
Adi_P_
Beginner
1,412 Views

I have same problem with you. And I am still looking for solution. I hope anyone who can solve this problem.

0 Kudos
Adi_P_
Beginner
1,412 Views

Hi thoriq, can i see your code ?

0 Kudos
Thoriq_S_
Beginner
1,412 Views

sorry, i have lost my code..

0 Kudos
Xingyi_S_Intel
Employee
1,412 Views

David Lu (Intel) wrote:

This is known issue and we will fix it in the future release. Thanks for supporting RealSense SDK.

Hi David,

I saved Face Data to a .dat file. Next time RealSense demo starts, it automatically load the .dat file. But after the same face into Camera's view, RealSense cannot recognize the face until about 1300ms later. In other words, after loaded registered face data, RealSense  cannot recognize the face right now. I write the demo reference to DF_FaceTracking, RecognitionModuleData::QueryDatbaseBuffer() is used to save face data, RecognitionConfiguration::SetDatabaseBuffer() is used to load face data. Do anything else need I to do? Thank you.

0 Kudos
Reply