How to get the 5 most popular colors from the camera preview in android and calculate their percentage of appearance? (The data should be updated regularly and continuously, from camera preview and not from image).
Asked
Active
Viewed 27 times
0
-
How regularly are we talking realtime or like every 3-5 seconds? – avalerio Jun 20 '21 at 23:24
-
@avalerio In realtime – Lev T. Jun 21 '21 at 08:03
-
This should get you started https://stackoverflow.com/questions/6478375/how-can-i-manipulate-the-camera-preview . I don't think any of these solutions are full solutions, but from what I understand you will need to receive a byte stream from the camera view. Do your calculations on chucks of the stream and then post results. How real time you can get it based on how complex your logic is. But if the camera is running at 60fps you will have a lot of stream data and a lot of duplicate data at that. And then you will need to post back to the UI thread with a relevant calculations good luck. – avalerio Jun 21 '21 at 11:21