Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- comp = cv2.compareHist(H1, H2, cv2.HISTCMP_CHISQR)
- height, width = gray_image.shape
- while comp >= maxDist:
- for x in range(height):
- gray_image[x,0] = 255
- gray_image[x, width-1] = 255
- for y in range(width):
- gray_image[0,y] = 255
- gray_image[height-1, y] = 255
- cv2.imshow("image", gray_image)
- H1 = cv2.calcHist( gray_image, [0], None, [256], [0,256])
- H2 = cv2.calcHist(gray_image, [0], None, [256], [0,256])
- comp = cv2.compareHist(H1, H2, cv2.HISTCMP_CHISQR)
- print(comp)
- cv2.waitKey(0)
- camera.release()
- cv2.destroyAllWindows()
- else:
- camera.release()
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement