Canny边缘检测-OpenCV

Canny边缘检测-OpenCV,opencv,computer-vision,feature-detection,edge-detection,Opencv,Computer Vision,Feature Detection,Edge Detection,有人能解释一下为什么OpenCV中可用的Canny边缘检测器会产生灰度结果吗 我正在Python界面上运行cv2.Canny函数,下面是我的代码 import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2.imread('foreground_output.jpg',0) highthresh = 250 lowthresh = 100 edges = cv2.Canny(img,lowthresh,h

有人能解释一下为什么OpenCV中可用的Canny边缘检测器会产生灰度结果吗

我正在Python界面上运行cv2.Canny函数,下面是我的代码

import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('foreground_output.jpg',0)
highthresh = 250
lowthresh = 100
edges = cv2.Canny(img,lowthresh,highthresh)

plt.imshow(edges,cmap = 'gray')

这是我的结果。我的印象是结果将是黑白二值图像边缘或非边缘。有人能解释一下为什么不是。你能通过显示边缘来验证假设值吗?当我看你提供的图像时,我看到带白线的黑色图像,这与我习惯的Canny结果一致。