简体   繁体   English

渲染脚本,图像处理,从预先计算的数组分配像素值

[英]Renderscript, image processing, assigning pixel values from a precomputed array

I have an array of precomputed intensity (computed using a fuzzy logic inference system on a desktop machine). 我有一组预先计算的强度(使用台式机上的模糊逻辑推理系统进行计算)。 Now I want to use this array as a lookup table for a contrast enhancement application on android, using renderscript. 现在,我想将此数组用作使用renderscript在android上进行对比度增强的应用程序的查找表。

What I want to do, at a highlevel is to process every pixel in an image, and using the lookup table create a new image where the pixel at the corresponding position has the value looked up in the array. 我想做的是概括地处理图像中的每个像素,并使用查找表创建一个新图像,其中在相应位置的像素具有在数组中查找的值。 Before I start looking at how to implement this, is this even feasible? 在我开始研究如何实现这一目标之前,这是否可行?

Yes, it is feasible and this is something RS can handle with no problems. 是的,这是可行的,这是RS可以毫无问题地处理的。 You'll need to provide your RS "kernel" with the pre-computed array data as either a separate Allocation or just a data array. 您需要为RS“内核”提供预先计算的阵列数据,作为单独的“ Allocation或仅作为数据阵列。

This talk will help get you started: https://youtu.be/3ynA92x8WQo 该演讲将帮助您入门: https : //youtu.be/3ynA92x8WQo

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM