小编Ewe*_*ley的帖子

F#中的位移和字节到int转换

我正在使用kinect在F#中做一些事情,但是在使用深度数据时遇到了一些麻烦.我一直在关注本教程:http://digitalerr0r.wordpress.com/2011/06/21/kinect-fundamentals-3-getting-data-from-the-depth-sensor/

有c#例子,我一直试图转换为F#.

这部分代码存在问题:

void kinectSensor_DepthFrameReady(object sender, ImageFrameReadyEventArgs e)
{
PlanarImage p = e.ImageFrame.Image;

    Color[] DepthColor = new Color[p.Height * p.Width];

    float maxDist = 4000;
    float minDist = 850;
    float distOffset = maxDist – minDist;

    kinectDepthVideo = new Texture2D(GraphicsDevice, p.Width, p.Height);

    int index = 0;
    for (int y = 0; y < p.Height; y++)
    {
        for (int x = 0; x < p.Width; x++, index += 2)
        {
            int n = (y * p.Width + x) * 2; …
Run Code Online (Sandbox Code Playgroud)

xna f# bitwise-operators kinect

0
推荐指数
1
解决办法
1343
查看次数

标签 统计

bitwise-operators ×1

f# ×1

kinect ×1

xna ×1