Software Archive
Read-only legacy content
17060 ディスカッション

mask_utils in Unity?

Austin_C_
ビギナー
2,062件の閲覧回数

I want the functionality of mask_utils that will mask out my hand in Unity.

Will this be supported?

0 件の賞賛
4 返答(返信)
Xusheng_L_Intel
従業員
2,062件の閲覧回数

Yes, it also supports in Unity. Please let me know if you have any issue. Thanks!

Austin_C_
ビギナー
2,062件の閲覧回数

Thanks for the reply.

Is there a Unity example of mask_utils? All I see is C++ and C#, and the C# version uses Microsoft Forms, so it's not so simple to port to Unity.

This PXCIMBlobExtractor example is not very helpful:

// session is a PXCMSession instance
// Get the the blob extractor instance
PXCMBlobExtractor be;
session.CreateImpl<PXCMBlobExtractor>(out be);
 
// Blob extracting operations
...
 
// Clean up
be.Dispose();

This doesn't explain how to add the blob info to an image, what the blob extractor does, or how it's useful.

Is there another place I can find a good example of using PXCIMBlobExtractor or PXCIMContourExtractor in Unity?

Thanks.

Amit_M_Intel
従業員
2,062件の閲覧回数

In the Unity Toolkit, we provide some scripts that use the Blob Extractor for detecting and tracking blobs. You should take a look at those. BlobDetectedRule.cs for example.

In any case, when querying the blob data, you are getting an image with the blob on it:

BlobExtractor.QueryBlobData(i, new_image, out blobData);

This should work (didn't tested it though):

// session is a PXCMSession instance
// Get the the blob extractor instance
PXCMBlobExtractor be;
session.CreateImpl<PXCMBlobExtractor>(out be);
// Blob extracting operations
PXCMImage.ImageInfo info;
info.format = PXCMImage.PixelFormat.PIXEL_FORMAT_Y8;
PXCMImage new_image = session.CreateImage(info);
...
// Clean up
new_image.Dispose();
be.Dispose();
Dagan_E_Intel
従業員
2,062件の閲覧回数

Austin,

Please note that the BlobExtractor will mask out anything that is seen in front of the camera, not only hands.

If you are specifically interested in hands only (and ignore anything else) you can have a look at the Hand module, where you can also find the mask (called Segmentation Image)

返信