Software Archive
Read-only legacy content
17061 Discussions

Getting Blob and face data at same time.

manish_k_2
Beginner
1,571 Views

Hi,

I want to get both face and blob data from same stream. I used EnableFace and EnableBlob to get both the data. I am able to get right co-ordinates for face data but when i use QueryExtremityPoint on blob data, results are quite different (co-ordinates are quite large compare to face ones). I am not sure whether querying both kind of data at same time is right or not? If someone can guide me to some sample it will be great.

 

Regards,

Manish

0 Kudos
11 Replies
Xusheng_L_Intel
Employee
1,571 Views

QueryExtremityPoint will return x and y coordinate of the image pixel. What kinds data did you get? Thanks!

0 Kudos
manish_k_2
Beginner
1,571 Views

Hi David,

I wanted to detect shoulder in real time (i.e. should be able to detect movement of shoulders upwards, rightwards etc.) but didn't find any way so thought of using blob's extreme points to get it. I am trying to do it on assumption that shoulders point would be left and right extreme points. But when i try to get face data as well as blob data, the points look quite different.

Thanks

Manish

0 Kudos
samontab
Valued Contributor II
1,571 Views

Manish, I would recommend you to work with the depth data directly as the SDK does not provide shoulder detection.

There are many different ways of doing this, you could keep it simple doing a basic blob detection/tracking, etc, up to having a full 3D model of the body matched in real time, and everything in between. It really depends on your particular application requirements, development time, etc.

Have a look at PCL, VTK, OpenCV, and other libraries that allow you to work with computer vision in 3D.

0 Kudos
manish_k_2
Beginner
1,571 Views

Hi Sebastian,

Thanks for the info. Do you have any tutorial link to integrate real sense with OpenCV (preferably C#)?

Thanks

Manish

0 Kudos
manish_k_2
Beginner
1,571 Views

Hi Sebastian,

I found a wrapper library Emgu for OpenCV. But not sure how to utilize it with real sense to detect different body points like shoulders arms etc. Please let me know if you have any info.

 

Regards,

Manish

0 Kudos
samontab
Valued Contributor II
1,571 Views

Well, you would need to know a bit about computer vision, machine learning, 3D data, etc. OpenCV is just a tool.

0 Kudos
manish_k_2
Beginner
1,571 Views

Hi Sebastian,

I was trying Emgu CV and found a haar cascade for head and shoulder detection. But when am trying to convert intel realsense PXCMImage to OpenCV image and use it to detect shoulder the value is not so promising. I am not sure the way i am converting the image is proper or not.

 

The code i have used to convert PXCMImage to OPenCV image is

 PXCMImage.ImageData data;


  if (image.AcquireAccess(PXCMImage.Access.ACCESS_READ, PXCMImage.PixelFormat.PIXEL_FORMAT_RGB32, out data) <
                pxcmStatus.PXCM_STATUS_NO_ERROR) return; 

 Mat matImage = new Mat(new System.Drawing.Size(image.info.width, image.info.height), DepthType.Cv8U, 3, data.planes[0],    data.pitches[0]);


            using (CascadeClassifier shoulder = new CascadeClassifier("haarcascade.xml"))
            {
                UMat ugray = new UMat();
                CvInvoke.CvtColor(matImage, ugray, Emgu.CV.CvEnum.ColorConversion.Bgr2Gray);

                //normalizes brightness and increases contrast of the image
                CvInvoke.EqualizeHist(ugray, ugray);
                Rectangle[] shoudersDetected = shoulder.DetectMultiScale(
                   ugray);
                List<Rectangle> shoulders = new List<Rectangle>();
                shoulders.AddRange(shoudersDetected);
                for(int i = 0; i < shoudersDetected.Length;i++ )
                {
                    Console.WriteLine(" shoulder"+ i +":X=" + shoudersDetected.X + " Y=" + shoudersDetected.Y);
                }
            }

 

Thanks 

Manish

0 Kudos
samontab
Valued Contributor II
1,571 Views

Well, try saving the image after you convert it and check if it looks alright before continuing the process...

0 Kudos
manish_k_2
Beginner
1,571 Views

Hi Sebastian,

I did try to save the image and it looked fine for me but it's still not able to detect soldiers. Can you please suggest  if any sample code/algorithm is available for detecting other body parts like shoulders in OPenCV?

Thanks

Manish

 

 

 

0 Kudos
samontab
Valued Contributor II
1,571 Views

OpenCV includes a pre trained haar-like cascade model for the upper body. That could solve your problem. Also you could combine it with face detection for an initial estimate on where the shoulders are.

0 Kudos
manish_k_2
Beginner
1,571 Views

Thanks Sebastian. I will try it.

0 Kudos
Reply