Face detection with C#.Net problem

Face detection with C#.Net problem

Hello all.

I have been working with Intel Perceptual SDK for couple of dys. I have got the gesture to work perfectly and precisely. But having problem with face detection.

I have posted my comment here:


with code that I have done. Can somebody please explain me what I am missing? by the way I am using vs 2010.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Rupam,

I fixed this by adding a null check to pxcmface.cpp:

Open the libpxcclr.sln file in Visual Studio (in program files/Intel/PCSDK/framework/CSharp/libpxcclr/).
Open the pxcmface.cpp file and change line 177 (PXCMFaceAnalysis::ProcessImageAsync) from this:

for (int i=0;iLength;i++) images2[i]=images[i]->QueryInstance();


for (int i=0;iLength;i++) if(images[i] != nullptr) images2[i]=images[i]->QueryInstance();

Now compile the .dll and rebuild your c# application.

Hello MasDennis.

Thank you so much for your answer. You showed me the actual cause of problem. Here is my simple work around without touching the dll which I inferred from your solution. Basically in PXCMImages images[] we are allocating 4 instances and there are no null check in actual dll. However if you observe the trace, every time only images[0] is a valid instance and others are null.

So I changed one line in C# solution rather than recompiling dll, which I do not prefer as product update makes it difficult to manage those changes.

Anybody else having a trouble, please call the ProcessImageAsync in following way

    sts = fa.ProcessImageAsync(new PXCMImage[]{images[0]}, out sps[1]);

Observe that I am passin only the first instance here.

Leave a Comment

Please sign in to add a comment. Not a member? Join today