# -*- coding: utf-8 -*-
"""
"""
import cv2
import numpy as np
from matplotlib import pyplot as plt
from preproces_max import *
from bisect import bisect


#img_num = 104467
#img_num=105058
img_num=345209

img = matplotlib.image.imread('images_training_rev1/'+str(img_num)+'.jpg')
color = ('r','g','b')

plt.subplot(122)
for i,col in enumerate(color):
    histr = cv2.calcHist([img],[i],None,[256],[0,256])
    plt.plot(histr,color = col)
    plt.yscale('log')
    plt.xlim([0,256])
plt.title('Color Histograms')

plt.subplot(121),plt.imshow(img)
plt.axis('off')
plt.title('Image')