#DICTLBL8 = loadObj("invariants_lbp_8")
#DICTLBL16 = loadObj("invariants_lbp_16")

STANDARD_W = 700
STANDARD_H = 525

#PERC_COMBS = (0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95)
PERC_COMBS = (0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90)
#PERC_COMBS = (0.5,)

HIST_LBP_R1P8 = 1
HIST_LBP_R2P16 = 2
HIST_LBP_R3P16 = 3
HIST_LBP_R3P24 = 4
HIST_LBP_R1P8_R2P16_CONCAT = 5
HIST_LBP_R1P8_R3P16_CONCAT = 6
HIST_LBP_R2P16_R3P16_CONCAT = 7
HIST_SURF = 8
HIST_BRIEF = 9
HIST_ORB = 10
HIST_HCoS = 11
HIST_HCoS_LBP_R1P8_R3P16_CONCAT = 12

#composed
HCoS_LBP_R1P8_R3P16 = 21

STANDARD_LEAF_AREA = 100000
STEM_KERNEL_SIZE = 12

KNN_DEFAULT = 25

BLACK = 0
WHITE = 255

MINIMUM_LEAF_VALID_CONTOUR_POINT_NUMBER = 300

FOLDER_HIST_LBP_R1P8 = "_LBPR1P8"
FOLDER_HIST_LBP_R2P16 = "_LBPR2P16"
FOLDER_HIST_LBP_R3P16 = "_LBPR3P16"
FOLDER_HIST_LBP_R3P24 = "_LBPR3P24"
FOLDER_HIST_LBP_R1P8_R2P16_CONCAT = "_LBP_R1P8_R2P16"
FOLDER_HIST_LBP_R1P8_R3P16_CONCAT = "_LBP_R1P8_R3P16"
FOLDER_HIST_LBP_R2P16_R3P16_CONCAT = "_LBP_R2P16_R3P16"
FOLDER_HIST_SURF = "_SURF"
FOLDER_HIST_BRIEF = "_BRIEF"
FOLDER_HIST_ORB = "_ORB"
FOLDER_HIST_HCoS = "_HCoS"
FOLDER_HIST_HCoS_LBP_R1P8_R3P16_CONCAT = "HCoS_LBP_R1P8_R3P16_CONCAT"

def matchHistToName(ht):
    if ht is tuple:
        return matchHistToName(ht[0]) + " " + matchHistToName(ht[1])
    if ht == HIST_LBP_R1P8:
        return FOLDER_HIST_LBP_R1P8
    if ht == HIST_LBP_R2P16:
        return FOLDER_HIST_LBP_R2P16
    if ht == HIST_LBP_R3P16:
        return FOLDER_HIST_LBP_R3P16
    if ht == HIST_LBP_R3P24:
        return FOLDER_HIST_LBP_R3P24
    if ht == HIST_LBP_R1P8_R2P16_CONCAT:
        return FOLDER_HIST_LBP_R1P8_R2P16_CONCAT
    if ht == HIST_LBP_R1P8_R3P16_CONCAT:
        return FOLDER_HIST_LBP_R1P8_R3P16_CONCAT
    if ht == HIST_LBP_R2P16_R3P16_CONCAT:
        return FOLDER_HIST_LBP_R2P16_R3P16_CONCAT
    if ht == HIST_SURF:
        return FOLDER_HIST_SURF
    if ht == HIST_BRIEF:
        return FOLDER_HIST_BRIEF
    if ht == HIST_ORB:
        return FOLDER_HIST_ORB
    if ht == HIST_HCoS:
        return FOLDER_HIST_HCoS
    if ht == HIST_HCoS_LBP_R1P8_R3P16_CONCAT:
        return FOLDER_HIST_HCoS_LBP_R1P8_R3P16_CONCAT
#DICTLBL8 = loadObj("invariants_lbp_8")
#DICTLBL16 = loadObj("invariants_lbp_16")

STANDARD_W = 700
STANDARD_H = 525

#PERC_COMBS = (0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95)
PERC_COMBS = (0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90)
#PERC_COMBS = (0.5,)

HIST_LBP_R1P8 = 1
HIST_LBP_R2P16 = 2
HIST_LBP_R3P16 = 3
HIST_LBP_R3P24 = 4
HIST_LBP_R1P8_R2P16_CONCAT = 5
HIST_LBP_R1P8_R3P16_CONCAT = 6
HIST_LBP_R2P16_R3P16_CONCAT = 7
HIST_SURF = 8
HIST_BRIEF = 9
HIST_ORB = 10
HIST_HCoS = 11
HIST_HCoS_LBP_R1P8_R3P16_CONCAT = 12

#composed
HCoS_LBP_R1P8_R3P16 = 21

STANDARD_LEAF_AREA = 100000
STEM_KERNEL_SIZE = 12

KNN_DEFAULT = 25

BLACK = 0
WHITE = 255

MINIMUM_LEAF_VALID_CONTOUR_POINT_NUMBER = 300

FOLDER_HIST_LBP_R1P8 = "_LBPR1P8"
FOLDER_HIST_LBP_R2P16 = "_LBPR2P16"
FOLDER_HIST_LBP_R3P16 = "_LBPR3P16"
FOLDER_HIST_LBP_R3P24 = "_LBPR3P24"
FOLDER_HIST_LBP_R1P8_R2P16_CONCAT = "_LBP_R1P8_R2P16"
FOLDER_HIST_LBP_R1P8_R3P16_CONCAT = "_LBP_R1P8_R3P16"
FOLDER_HIST_LBP_R2P16_R3P16_CONCAT = "_LBP_R2P16_R3P16"
FOLDER_HIST_SURF = "_SURF"
FOLDER_HIST_BRIEF = "_BRIEF"
FOLDER_HIST_ORB = "_ORB"
FOLDER_HIST_HCoS = "_HCoS"
FOLDER_HIST_HCoS_LBP_R1P8_R3P16_CONCAT = "HCoS_LBP_R1P8_R3P16_CONCAT"

def matchHistToName(ht):
    if ht is tuple:
        return matchHistToName(ht[0]) + " " + matchHistToName(ht[1])
    if ht == HIST_LBP_R1P8:
        return FOLDER_HIST_LBP_R1P8
    if ht == HIST_LBP_R2P16:
        return FOLDER_HIST_LBP_R2P16
    if ht == HIST_LBP_R3P16:
        return FOLDER_HIST_LBP_R3P16
    if ht == HIST_LBP_R3P24:
        return FOLDER_HIST_LBP_R3P24
    if ht == HIST_LBP_R1P8_R2P16_CONCAT:
        return FOLDER_HIST_LBP_R1P8_R2P16_CONCAT
    if ht == HIST_LBP_R1P8_R3P16_CONCAT:
        return FOLDER_HIST_LBP_R1P8_R3P16_CONCAT
    if ht == HIST_LBP_R2P16_R3P16_CONCAT:
        return FOLDER_HIST_LBP_R2P16_R3P16_CONCAT
    if ht == HIST_SURF:
        return FOLDER_HIST_SURF
    if ht == HIST_BRIEF:
        return FOLDER_HIST_BRIEF
    if ht == HIST_ORB:
        return FOLDER_HIST_ORB
    if ht == HIST_HCoS:
        return FOLDER_HIST_HCoS
    if ht == HIST_HCoS_LBP_R1P8_R3P16_CONCAT:
        return FOLDER_HIST_HCoS_LBP_R1P8_R3P16_CONCAT
#DICTLBL8 = loadObj("invariants_lbp_8") #DICTLBL16 = loadObj("invariants_lbp_16") #PERC_COMBS = (0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95) #PERC_COMBS = (0.5,) #composed