Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- counter=0
- index = {}
- images = {}
- results =[]
- while counter<total_count:
- name="test%d.jpg" % counter
- image = cv2.imread(name)
- images[name] = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
- hist = cv2.calcHist(image, [0, 1, 2], None, [8, 8, 8],[0, 256, 0, 256, 0, 256])
- hist = cv2.normalize(hist, hist).flatten()
- index[name] = hist
- counter+=25
- counter=0
- i=0
- for (k, hist) in index.items():
- results.append([])
- name1="test%d.jpg" % counter
- name2="test%d.jpg" % (counter+25)
- if(counter<total_count-25):
- d = cv2.compareHist(index[name1], index[name2], cv2.HISTCMP_CORREL)
- results[i].append(d)
- results[i].append(1)
- counter+=25
- i+=1
- print results
Add Comment
Please, Sign In to add comment