Nuitrack's BodyImage not working with SkiaTexture?

Hi, I’m trying to use Fuse’ particles Texture3DForceField with Nuitrack’s BodyImage and notice that while in Renderer (skia) the body masks are shown, in SkiaTexture they do not. How can I fix this ?
gamma version 2021.4.0 preview 0506

Just a wild guess here but could it be related to the format of the texture? Have you tried more “normal” formats like R8G8B8A8 for example?

@ravazquez do you mean convert the format of BodyImage using OpenCV ?
I’m not sure it is what I’m looking for… I want to use the image after it is elaborated in DrawImage, as seen in Skia renderer, as a texture. because otherwise I don’t know how else to make body silhouette visible… BodyImage alone is only a black image (I think)
I hope it is clear.
ezgif-1-d8842d777b3a

@jib don’t think OpenCV is needed. The SkiaTexture node has a Format input pin, try playing around with that one.

As you can see the format of BodyImage is R16 yet the format coming out of SkiaTexture in your screenshot is R16G16B16A16.

Again, I am not 100% sure this is the source of the issue but I think it’s worth a shot.

Hope that helps

@ravazquez I see, thanks !
I’ve just tried to change SkiaTexture format. I tried every format that there is (100 formats btw !, a lot more that I expected) but none of them works…

Sorry to hear that, let me try and get Nuitrack up and running over here to see if I can help further.

1 Like

OK @jib so there are a few things to go over in order to better understand what is going on here:

First, the image that you get from BodyImage is not an image you can “see” but rather it holds discrete values for the background and each detected player. So for example any pixel containing no players (background) will contain a value of 0, any pixel belonging to the first detected player will hold a value of 1, any pixel belonging to the second detected player will contain a value of 2 and so on, but again this is not really visible to the naked eye.

Now, when you do the LUT pass, this filter is effectively replacing each of those values with a visible color value, so in your screenshot, all pixels with a value of 0 will be overwritten with a value of black, all pixels with a value of 1 will be replaced with blue, all pixels with a value of 2 will be replaced with red and so on (based on the entries of your LUT’s color spread). This is why the players become visible.

I am not entirely sure what your final goal is, but if you just need to get a visible image in Stride based on the BodyImage output, you can go for a quick Levels TextureFX as shown below, tweaking the From White input pin:

image

If you need something more sophisticated like LUT in Stride you will need to write your own shader/TextureFX to read those non-visible values and replace them with whatever makes sense for your specific scenario. Chances are high an LUT TextureFX will be added soon but it is not there yet.

If you need to draw some things on top of this texture using Skia, you can still do that in Skia, pass it through SkiaTexture and then blend it with the Stride player texture.

As for the cause of why connecting the DrawImage in your screenshot to SkiaTexture fails to show anything, we had a close look at it and it seems to be somehow related to ColosSpaces, but this is a rabbit hole of it’s own and I would suggest to avoid it if you can. In general terms something is broken there and will need to be dealt with but in any case, if your end goal is to get to Stride land, TextureFX and shaders is the way to go, and that pipeline does not have the problem you are getting with SkiaTexture.

Phew… that was a long reply. I hope it helps you understand a bit better what is going on and how to move forward.

Cheers!

Wow… thanks @ravazquez ! now it’s clear to me what’s going on.
I’m not capable of writing a shader myself so, having LUT TextureFX would be superb but for now Levels is just as fine ! Now I can move forward, thank you again!

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.