Esempio n. 1
0
    img = cv2.imread(imagePath)
    histo_tool = HistogramAnalyzer(img)

    colorAverage = HSBColor(histo_tool.get_hue_average(),
                     histo_tool.get_saturation_average(),
                     histo_tool.get_brigthness_average())
    
    if options_verbose:
        print("### Average : ")
        print(colorAverage)
        print "Temperature : %2f" % colorAverage.temperature()
        print "Brightness : %2f" % colorAverage.brightness()

    colorMax = HSBColor(histo_tool.get_hue_max(),
                     histo_tool.get_saturation_max(),
                     histo_tool.get_brigthness_max())

    if options_verbose:
        print("### Maximum : ")
        print(colorMax)
        print "Temperature : %2f" % colorMax.temperature()
        print "Brightness : %2f" % colorMax.brightness()

    #Select the HSBColor to use between colorAverage or colorMax
    colorToUse = colorMax

    ##FaceDetect
    detector = ImageElementDetect(imagePath, False)
    # print("Nb faces : " + detector.countFaces())
    # hasFaces = detector.hasFaces()
    # hasFaces = False