(Java) Tutorial Face Recognition Real Sense Technology SR300

Feb. 19, 2017, 5:44 p.m. 5 2532

Before proceeding with this tutorial, you must have installed the drivers on your computer and the camera can run well. to try the Real Sense camera you can use the Real Sense SDK Intel. download here SDK and Driver https://software.intel.com/en-us/intel-realsense-sdk

Call module PXCMSenseManager for read camera SR300 ready your computer.

 PXCMSenseManager senseMgr = PXCMSenseManager.CreateInstance();

        if (senseMgr == null) {
            System.out.println("Failed to create a sense manager instance.");
            return;
        }

        pxcmStatus sts = senseMgr.EnableFace(null);
        PXCMFaceModule faceModule = senseMgr.QueryFace();

        if (sts.isError() || faceModule == null) {
            System.out.println("Failed to initialize face module.");
            return;
        }

Call Module PXCMFaceConfiguration that we use the module to read the position of the face with a real sense of technology

 sts = pxcmStatus.PXCM_STATUS_DATA_UNAVAILABLE;
 PXCMFaceConfiguration faceConfig = faceModule.CreateActiveConfiguration();
 PXCMFaceConfiguration.RecognitionConfiguration rcfg = faceConfig.QueryRecognition();
 rcfg.Enable();

Call Module QueryCaptureManager to take the face with the algorithms used to make real sense so that the results can be used to distinguish the faces of everybody

 PXCMCapture.Device dev = senseMgr.QueryCaptureManager().QueryDevice();
 PXCMCapture.DeviceInfo info = new PXCMCapture.DeviceInfo();
 dev.QueryDeviceInfo(info);
 System.out.println("Using Camera: " + info.name);

Call Module PXCMFaceData.RecognitionData to open the data results in the can by realsense in the form of 6 bytes

        PXCMFaceData faceData = faceModule.CreateOutput();
        for (int nframes = 0; nframes < 30000; nframes++) {
            senseMgr.AcquireFrame(true);
            PXCMCapture.Sample sample = senseMgr.QueryFaceSample();

            //faceData = faceModule.CreateOutput();
            faceData.Update();

            // Read and print data 
            for (int fidx = 0;; fidx++) {
                PXCMFaceData.Face face = faceData.QueryFaceByIndex(fidx);
                if (face == null) {
                    break;
                }

                PXCMFaceData.RecognitionData rdata = face.QueryRecognition();

                // recognize the current face?
                int uid = rdata.QueryUserID();
                System.out.println("data" + uid);
                if (uid >= 0) {
                    System.out.println("data" + uid);
                }
            }

            //faceData.close();
            senseMgr.ReleaseFrame();
        }

Check out Github code

https://github.com/aerdy/Java-RealSense_FaceRecognition

 

Tentang Penulis

Vimio

Kalau bisa jadi 10 akan kita jadikan semua nya 10, 10 jika nilai 0 - 10 yang tertinggi. tapi sayangnya ketika nilai dan niat saling menghianati. bersyukurlah semua apa yang kita dapat dan yang telah di berikan. ya itu nilai 10 yang dikasih. { 1 0 }

Komentar