I need to find the average value and standard deviation of pixel values ββby mask on mobile devices with support for OpenGL ES 3.0. (I'm trying to write something like meanStdDev from OpenCV.)
But OpenGL ES does not provide any global pixel operations such as sum. This is actually the only global operation I need, because I can subtract or find squares with shader fragments.
At the moment, I am calculating the sums with two nested loops, but I think this is the wrong way.
I read about hacks with mip-mapping, but as I understand it, it applies only to images whose size is equal to the power of two. And I do not know how to use it with a mask.
What is the fastest way to solve a problem?
PS I'm new to OpenGL.
source share