以高分辨率渲染相机,onPreviewFrame中的图像质量较低

时间:2022-01-04 18:54:55

I have a closed source library for AR, and i must call method from this library with width, height and byte[] parameters(in onPreviewFrame callback). I render preview with opengles 2.0 and SurfaceTexture. I wish to render in higher resolution and transmit data to library in lower resolution. Is it possible?

我有一个用于AR的封闭源库,我必须使用width,height和byte []参数调用此库中的方法(在onPreviewFrame回调中)。我用opengles 2.0和SurfaceTexture渲染预览。我希望以更高的分辨率渲染并以较低的分辨率将数据传输到库。可能吗?

1 个解决方案

#1


1  

No it isn't. Most image processing libraries know how to downscale their input. If yours is not the case, you should resample the byte[] in your onPreviewFrame() callback for it. Note that often AR processes only need grayscale, and thus you can save 33% of CPU cycles of downscaling.

不,不是。大多数图像处理库都知道如何缩小其输入。如果不是这种情况,则应重新对onPreviewFrame()回调中的byte []进行重新采样。请注意,AR流程通常只需要灰度,因此可以节省33%的缩减CPU周期。

#1


1  

No it isn't. Most image processing libraries know how to downscale their input. If yours is not the case, you should resample the byte[] in your onPreviewFrame() callback for it. Note that often AR processes only need grayscale, and thus you can save 33% of CPU cycles of downscaling.

不,不是。大多数图像处理库都知道如何缩小其输入。如果不是这种情况,则应重新对onPreviewFrame()回调中的byte []进行重新采样。请注意,AR流程通常只需要灰度,因此可以节省33%的缩减CPU周期。