# Extraction informations 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()
from HistogramAnalyzer import HistogramAnalyzer import cv2 if __name__ == "__main__": img = cv2.imread('../images/sunset_orange.jpg') #cv2.imshow('original', img) histo_tool = HistogramAnalyzer(img) #histo_tool.show_rgb_hist() #histo_tool.show_hsv() histo_tool.show_hsv_hist() print(histo_tool.get_hue_max()) print(histo_tool.get_saturation_max()) print(histo_tool.get_brigthness_max()) #histo_tool.show_rgb() #histo_tool.show_rgb_hist() cv2.waitKey(0) cv2.destroyAllWindows()