Python Forum
Sort Matrices by Mean Value Obtained (OpenCV, Python and Numpy)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sort Matrices by Mean Value Obtained (OpenCV, Python and Numpy)
#2
You can use numpy.argsort to sort by mean values,
look at the following example (for red channel):

r_inds = np.argsort(np.array(r_submatrices).reshape(-1, len(r_submatrices)).mean(axis=0))[::-1]
np.array(r_submatrices)[r_inds]  # sorted array 
Reply


Messages In This Thread
RE: Sort Matrices by Mean Value Obtained (OpenCV, Python and Numpy) - by scidam - May-03-2019, 12:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to sort a list without .sort() function letmecode 3 3,451 Dec-28-2020, 11:21 PM
Last Post: perfringo
  Editing images using python and opencv caaaameron_ 6 3,122 May-06-2020, 10:55 AM
Last Post: caaaameron_
  [split] Manual Sort without Sort function fulir16 2 3,176 Jun-02-2019, 06:13 AM
Last Post: perfringo
  Manual Sort without Sort function dtweaponx 26 49,010 Jun-01-2019, 06:02 PM
Last Post: SheeppOSU

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020