Android Question What is the best/fastest way of computing the overall brightness value of image from Camera_Preview?

HappyDad

Member
Licensed User
Longtime User
I am using Camera_Preview to get low resolution images using camera, and wants to compute the overall brightness of the image.
Now I am thinking of dealing with the data() directly in Camera_Preview sub, and calculate an average of the Y data of all pixels.
But, I am not sure whether the codes will run fast enough. I mean whether it is appropriate to put codes in Camera_Preview.
Is there any other ways of doing it?
For example, I see there is RenderScript functions.
Is there any function that can do this fast?
 

JordiCP

Expert
Licensed User
Longtime User
The fastest way is to subsample rows and colums of the preview image, and find its average, similar to how it was done HERE, but averaging instead of thresholding.

If you want to compute the mean or whatever of the whole image, then the fastest way is with OPENCV
 
Upvote 0
Top