2017-02-15 71 views
1

我想重新创建EKG上的跟踪,然后将它们覆盖到新的网格上,但我坚持如何最好地跟踪实际跟踪。在后面的图片中,我想重新创建6个单独的跟踪,基本上是使用网格的白色背景。任何帮助,将不胜感激。OpenCV检测并跟踪图像上最暗的线条并覆盖网格

我设法找到边缘,从JPG,因此所有我留下作物,这是这一形象:enter image description here

我试图检测与任何的OpenCV的findContours或霍夫线变换,但我边描高斯模糊后的发现留给我:enter image description here ..这不是很有帮助。

霍夫线是这样的:enter image description here

有人能指出我在正确的方向?提前致谢。

编辑:

我做了局部直方图,然后高斯模糊,另一Canny边缘检测。局部直方图形象是:enter image description here

再精明的边缘检测是: enter image description here

+0

最佳canny边缘检测? –

+1

之前,尝试预处理您的图像 –

+0

我发现那些边缘与canny,它只是出来这样,是否有某些设置调整? – nahata5

回答

1

您可以尝试使用索贝尔和拉普拉斯探测器如下

img = cv2.imread('experiment.png') 
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) 
img = cv2.GaussianBlur(img,(3,3),0) 
laplacian = cv2.Laplacian(img,cv2.CV_64F)  
sobelx = cv2.Sobel(img,cv2.CV_64F,1,0,ksize=1) 

figure = plt.figure(figsize=(10,10)) 

sobel = figure.add_subplot(1,2,1) 
sobel.imshow(sobelx,cmap='gray') 
sobel.set_title('Sobel in x') 
sobel.set_axis_off() 

laplacianfig = figure.add_subplot(1,2,2) 
laplacianfig.imshow(laplacian,cmap='gray') 
laplacianfig.set_title('Laplacian') 
laplacianfig.set_axis_off() 

给你以下输出

enter image description here

正如你所看到的,S obel操作符可以用来检测线条。也许你可以绘制像素强度低于平均值的那些点。