更改颜色帧分辨率以加快处理速度 [英] Changing Color frame resolution to enable faster processing

查看:73
本文介绍了更改颜色帧分辨率以加快处理速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨;


有没有办法将彩色帧分辨率从1920X1080p降低到更低的分辨率,以便加快处理速度?



谢谢

解决方案

通过更快的处理,您的意思是让您的应用更快地运行?或者减少Kinect数据流的带宽?


Kinect是一个只读设备,似乎微软不会允许Windows SDK控制该硬件。但是,您可以通过简单地处理较少的数据来减少应用程序的处理量。


因此,不要使用以下方法处理颜色框:

 for(int y = 0; y< 1080; y ++)
{
for(int x = 0; x< 1920; x ++)
{
int index = y * 1920 + x;

//修改数据
}
}

你可以做720p的提取像这样:

 

for(int y = 180; y< 900; y ++)
{
for(int x = 320; x< 1600; x ++)
{
int index = y * 1920 + x;

//修改数据
}
}

甚至是qHD 960x540图像,它可以保持完整的视野:

 for(int y = 0; y< 1080; y + = 2)
{
for(int x = 0; x< 1920; x + = 2)
{
int index = y * 1920 + x;

//修改数据
}
}

你必须放置您处理成新的较小字节数组的数据。请记住,因为您在这里处理图像,如果您只需要显示彩色图像,这实际上比仅显示完整的1920x1080
图像要慢。


<但是,如果您对颜色数据进行重要处理,则可以减少处理的像素数量并加快应用程序的运行。


甚至可能有办法降低分辨率在GPU上使用计算着色器。但据我所知,这是获得较低分辨率图像的最快方法。


希望有所帮助!


Hi;

Is there any way of reducing the color frame resolution from 1920X1080p to a lower resolution so as to enable faster processing?

Thanks

解决方案

By faster processing do you mean have your app run faster? Or reduce the bandwidth of the Kinect's data stream?

The Kinect is a read only device and it does not seem like Microsoft will ever allow that hardware to be controlled by the Windows SDK. However you can reduce the amount of processing your application does by simply processing less data.

So instead of processing a color frame with:

for(int y = 0; y < 1080; y++)
{
    for(int x = 0; x < 1920; x++)
    {
        int index = y * 1920 + x;

        // Modify data
    }
}

You could do a 720p extract like so:

for(int y = 180; y < 900; y++) { for(int x = 320; x < 1600; x++) { int index = y * 1920 + x;

// Modify data } }

or even a qHD 960x540 image which would maintain the full field of view:

for(int y = 0; y < 1080; y += 2)
{
    for(int x = 0; x < 1920; x += 2)
    {
        int index = y * 1920 + x;

        // Modify data
    }
}

You would have to place the data that you process into a new smaller byte array. Keep in mind that because you're processing the image here, if all you need to do is display a color image this would actually be slower than just displaying the full 1920x1080 image.

But if you are doing significant processing to the color data you can reduce the amount of pixels you are processing and speed up your application.

There may even be a way to reduce the resolution on the GPU by using compute shaders. But as far as I know right now this is the fastest way to get a lower resolution image.

Hope that helps!


这篇关于更改颜色帧分辨率以加快处理速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆