1 | initial version |
#step 1: make a3 channel, bgr or rgb image from the canny output:
edges = cv2.Canny(m,100,200)
rgb = cv2.cvtColor(edges, cv2.COLOR_GRAY2RGB) # RGB for matplotlib, BGR for imshow() !
#step2: now all edges are white (255,255,255). to make it red, multiply with another array:
rgb *= np.array((1,0,0),np.uint8) #set r and b to 0, leaves red :)
2 | No.2 Revision |
#step # step 1: make a3 channel, bgr or rgb image from the canny output:
edges = cv2.Canny(m,100,200)
rgb = cv2.cvtColor(edges, cv2.COLOR_GRAY2RGB) # RGB for matplotlib, BGR for imshow() !
#step2: # step2: now all edges are white (255,255,255). to make it red, multiply with another array:
rgb *= np.array((1,0,0),np.uint8) #set r # set g and b to 0, leaves red :)
3 | No.3 Revision |
# step 1: make a3 channel, bgr or rgb image from the canny output:
edges = cv2.Canny(m,100,200)
rgb = cv2.cvtColor(edges, cv2.COLOR_GRAY2RGB) # RGB for matplotlib, BGR for imshow() !
# step2: step 2: now all edges are white (255,255,255). to make it red, multiply with another array:
rgb *= np.array((1,0,0),np.uint8) # set g and b to 0, leaves red :)
# step 3: compose:
out = np.bitwise_or(im2, rgb)