Software Archive
Read-only legacy content
17060 Discussions

how to load image

Tooru_A_
Beginner
483 Views
Hi, please advice me how to load image. I want to load pre-recorded image and detect face. when I use PerC SDK 2013, I can load it and get face data. However, RealSense SDK might hide the function to load an image, don't it? PerC SDK 2013 --------------------------------------------------- sts = face->ProcessImageAsync(&img1, sps.ReleaseRef(1)); --------------------------------------------------- PXCVideoModule class has ProcessImageAsync method. I don't know how to get instance of PXCVideoModule. Could you give me an advice or sample to load an image not live camera? Thanks.
0 Kudos
5 Replies
Xusheng_L_Intel
Employee
483 Views

Here you go. Hope it will give you help.

PXCSyncPoint* sp = NULL;
PXCImage* image = NULL;

createImage(&image);
PXCCapture::Sample* sample = new PXCCapture::Sample();
sample->color = image;
		
do {
	sts = psm->QueryCaptureManager()->ReadModuleStreamsAsync(pFaceConfig->CUID, sample, &sp);
      }while (sts < PXC_STATUS_NO_ERROR);
		
sp->Synchronize();

faceOutput->Update();

faceOutput->QueryFaceByIndex(0)->QueryRecognition()->RegisterUser();

 

0 Kudos
Tooru_A_
Beginner
483 Views
Hi, David. Thank you very much! I tried your code. But the process loops infinitely from LINE08 to LINE10. LINE09 ReadModuleStreamAsync method returns PXC_STATUS_ITEM_UNAVAILABLE(-3) Do you know why?
0 Kudos
Xusheng_L_Intel
Employee
483 Views

That means the SDK did not find the device meet the requirement. Do you have Intel 3D camera? The 3D camera is default in facial module. You need pFaceConfig->SetTrackingMode(PXCFaceConfiguration::TrackingModeType::FACE_MODE_COLOR); if you want to use 2D camera in facial module. Enjoy!

0 Kudos
Tooru_A_
Beginner
483 Views
I don't have Intel 3D camera. I'm using Surface Pro 3 with inner camera "Microsft LifeCam Front". I did pFaceConfig->SetTrackingMode(PXCFaceConfiguration::TrackingModeType::FACE_MODE_COLOR); the result is same. LINE09 ReadModuleStreamAsync method returns PXC_STATUS_ITEM_UNAVAILABLE(-3) I tried to change CUID. sts = captureManager->ReadModuleStreamsAsync(PXCFaceModule::CUID, sample, &sp); Then, ReadModuleStreamAsync method returns PXC_STATUS_NO_ERROR(0). But m_output->QueryFaceByIndex(0) returns NULL
0 Kudos
Tooru_A_
Beginner
483 Views
please help me. I haven't yet solve my problem.
0 Kudos
Reply