python - python2.7 histogram comparison - white background anomaly -
my program's purpose take 2 images , decide how similar are. im not talking here identical, similarity. example, if take 2 screenshots of 2 different pages of same website, theme colors similar , therefor want program declare similar. my problem starts when both images have white background pretty takes on histogram calculation (over 30% of image white , rest distributed). in case, cv2.comparehist (using correlation method, works other cases) gives bad results, is, grade high though different. i have thought taking white (255) off histogram before comparing, requires me calculate histogram 256 bins, not when want check similarity (i thought using 32 or 64 bins best) unfortunately cant add images im working due legal reasons if can idea, or code solves grateful thank much you can remove white color, rebin histogra , compare: compute histrogram 256 bins. remove white bin (or make zero). regroup bins have 64 bins adding values of 4 consecutive bins. pe...