- Joined
- Apr 7, 2022
- Messages
- 14
- Reaction score
- 0
my_list = [[R1,G1,B1],[R2,G2,B2],...] is a list of red, green, blue value of a pixels. Each pixel has an R,G,B value.
I want to find the mode of the most common RGB value.
If there are multiple modes, I then need the average R, average G, average B
I feel like if I give some examples It'll explain what I am after:
my_list = [[1,2,3],[4,5,6],[1,8,9],[1,2,3],[1,8,9]]
The modes of my_list would be: [1,2,3],[1,8,9]
Average R (0th terms) = (1+1)/2=1
Average G (1st terms) = (2+8)/2=5
Average B (2nd terms) = (3+9)/2=6
Below is a similar question however the order of the sub-lists can get mixed up, and I also dont know how to get the average of all the 0th terms (R), average of all 1st terms (G), average of all the 2nd terms (B):
stackoverflow.com
Any ideas?
I want to find the mode of the most common RGB value.
If there are multiple modes, I then need the average R, average G, average B
I feel like if I give some examples It'll explain what I am after:
my_list = [[1,2,3],[4,5,6],[1,8,9],[1,2,3],[1,8,9]]
The modes of my_list would be: [1,2,3],[1,8,9]
Average R (0th terms) = (1+1)/2=1
Average G (1st terms) = (2+8)/2=5
Average B (2nd terms) = (3+9)/2=6
Below is a similar question however the order of the sub-lists can get mixed up, and I also dont know how to get the average of all the 0th terms (R), average of all 1st terms (G), average of all the 2nd terms (B):
![stackoverflow.com](/proxy.php?image=https%3A%2F%2Fcdn.sstatic.net%2FSites%2Fstackoverflow%2FImg%2Fapple-touch-icon%402.png%3Fv%3D73d79a89bded&hash=e761f0995cdab9cfede9eff3357e9f5d&return_error=1)
Find mode of list of list
I want to find mode from list of list. So basically there will be one list which contains list of list. also, in every list the order doesn't matter. So ["red", "blue"] == ["
Any ideas?