我需要找到的医学图像边缘检测使用OpenCV巨蟒.Which边缘检测器将是最适合我的工作?我试过用canny边缘探测器。我想找出医学图像的边缘,并找到两幅图像之间的直方图匹配。(预先谢谢:)
发布于 2014-04-04 10:09:41
你能把你正在处理的照片发出来吗?这样会更好。
此外,您也可以尝试这段代码。它允许您更改canny滤波器、阈值1和阈值2的参数,因此您将了解如何将canny滤波器应用于图像。
import cv2
import numpy as np
def nothing(x):
pass
#image window
cv2.namedWindow('image')
#loading images
img = cv2.imread('leo-messi-pic.jpg',0) # load your image with proper path
# create trackbars for color change
cv2.createTrackbar('th1','image',0,255,nothing)
cv2.createTrackbar('th2','image',0,255,nothing)
while(1):
# get current positions of four trackbars
th1 = cv2.getTrackbarPos('th1','image')
th2 = cv2.getTrackbarPos('th2','image')
#apply canny
edges = cv2.Canny(img,th1,th2)
#show the image
cv2.imshow('image',edges)
#press ESC to stop
k = cv2.waitKey(1) & 0xFF
if k == 27:
break
cv2.destroyAllWindows()就直方图比较而言。您可以在这里找到所有与直方图相关的cv2 API。
http://docs.opencv.org/modules/imgproc/doc/histograms.html
希望能帮上忙。
https://stackoverflow.com/questions/22858053
复制相似问题