More natural sorting of MatType constants in performance reports.

This commit is contained in:
Andrey Kamaev
2012-01-16 07:04:26 +00:00
parent 61cb83b481
commit c326de43c1
3 changed files with 12 additions and 7 deletions

View File

@@ -2,8 +2,13 @@ import testlog_parser, sys, os, xml, glob, re
from table_formatter import *
from optparse import OptionParser
convert = lambda text: int(text) if text.isdigit() else text
alphanum_keyselector = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ]
numeric_re = re.compile("(\d+)")
cvtype_re = re.compile("(8U|8S|16U|16S|32S|32F|64F)C(\d{1,3})")
cvtypes = { '8U': 0, '8S': 1, '16U': 2, '16S': 3, '32S': 4, '32F': 5, '64F': 6 }
convert = lambda text: int(text) if text.isdigit() else text
keyselector = lambda a: cvtype_re.sub(lambda match: " " + str(cvtypes.get(match.group(1), 7) + (int(match.group(2))-1) * 8) + " ", a)
alphanum_keyselector = lambda key: [ convert(c) for c in numeric_re.split(keyselector(key)) ]
def getSetName(tset, idx, columns, short = True):
if columns and len(columns) > idx: