Ask Your Question

kadil's profile - activity

2021-01-06 05:26:02 -0600 received badge  Popular Question (source)
2017-04-14 16:24:50 -0600 asked a question change colour of canny output

I have a small script to visualise focus on an image, and very happy with the result but I want to be able to change the highlighted edges (currently white) to a different colour before overlaying on to the original image. My (cut-and-paste) code below, please help.

import cv2
import numpy as np
import matplotlib.pyplot as plot

im = cv2.imread('tests.jpg',0)
im2 = cv2.imread('tests.jpg')
edges = cv2.Canny(im,100,200)
out = np.bitwise_or(im2, edges[:,:,np.newaxis])
implot = plot.imshow(cv2.cvtColor(out, cv2.COLOR_BGR2RGB))
plot.show()

Thanks in advance