私はカラー ストリームから反対側の鏡像を作成しようとしています。つまり、右手が上に移動しているときに、左手が上に移動しなければならないように kinect が描画するようにします (右手が上げている実際の鏡の前とは異なります)。それを行うためにカラー画像を操作したい:X位置を移動するだけです。ただし、ブルースクリーンが表示されます:
void kinectSensor_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e)
{
try
{
using (ColorImageFrame colorImageFrame = e.OpenColorImageFrame())
{
if (colorImageFrame != null)
{
byte[] pixelsFromFrame = new byte[colorImageFrame.PixelDataLength];
colorImageFrame.CopyPixelDataTo(pixelsFromFrame);
Color[] color = new Color[colorImageFrame.Height * colorImageFrame.Width];
kinectRGBVideo = new Texture2D(graphics.GraphicsDevice, colorImageFrame.Width, colorImageFrame.Height);
// Go through each pixel and set the bytes correctly
// Remember, each pixel got a Rad, Green and Blue
int index = 0;
for (int y = 0; y < colorImageFrame.Height; y++)
{
for (int x = 0; x < colorImageFrame.Width; x++, index += 4)
{
color[(y * colorImageFrame.Width + x)] = new Color(pixelsFromFrame[(y+1)*(2560 -index)],
pixelsFromFrame[(y + 1) * (2560 - index)],
pixelsFromFrame[(y + 1) * (2560 - index)]);
}
}
// Set pixeldata from the ColorImageFrame to a Texture2D
kinectRGBVideo.SetData(color);
}
}
}
catch {
}
}
wearg とは誰か教えてもらえますか? ありがとう