It work, but my contour's color is black. How to change it to red or green?
import numpy as np
import cv2
from matplotlib import pyplot as plt
img = cv2.imread('1.jpg',0)
img1 = cv2.imread('5.jpg',0)
dest = cv2.subtract(img, img1)
res = cv2.bitwise_not(dest)
ret , threshold = cv2.threshold(res,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
cv2.namedWindow('thresimage', cv2.WINDOW_NORMAL)
cv2.imshow('thresimage',threshold)
_, contours, hierarchy = cv2.findContours(threshold,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)
print "Number of contours detected %d -> "%len(contours)
cv2.drawContours(threshold,contours,-1,(0,255,0),3)
cv2.namedWindow('contour', cv2.WINDOW_NORMAL)
cv2.imshow('contour',threshold)
cv2.waitKey(0)
cv2.destroyAllWindows()