2016-07-26 163 views
2

我有需要分割的相差显微镜图像。由于背景中的物体之间缺乏对比(图1),分割它们似乎非常困难。我使用功能adapthisteq来增加细胞的可见性(图像2)。有什么方法可以改善细胞的分割吗?改善低对比度图像分割

normalImage = imread(fileName); 
channlImage = rgb2gray(normalImage); 
histogramEq = adapthisteq(channlImage,'NumTiles',[50 50],'ClipLimit',0.1); 
saturateInt = imadjust(histogramEq); 
binaryImage = im2bw(saturateInt,graythresh(saturateInt)); 
binaryImage = 1 - binaryImage; 

normalImage - 原始图像 normalImage histogramEq - 增强的可视性图像 histogramEq binaryImage - 二值图像 binaryImage

回答

1

之前申请的门槛,我会通过使用单独从背景不同的模式白色礼帽。见here the result。那么你stretch the histogram

然后你可以应用你所做的。

+0

嗨,增加了行'tophatImage = imtophat(histogramEq,strel( '磁盘',7))''后histogramEq'。结果看起来与您的非常相似,但不同之处在于,与您的背景相比,感兴趣的对象看起来更亮。你是如何照亮感兴趣的物体? '伸展直方图'是什么意思? – Senyokbalgul

+0

我的建议是在adapthisteq之前应用大礼帽,而不是之后。顶帽对照明变化不敏感。我添加了一个关于直方图拉伸的链接。 – FiReTiTi

+0

它仍然似乎没有帮助准确分割。 – Senyokbalgul

0

我想建立在FiReTiTi的答案上。我有下面的代码和一些截图。我已经这样做了OpenCV的使用3.0.0

import cv2 

x = 'test.jpg' 
img = cv2.imread(x, 1) 
cv2.imshow("img",img) 

#----converting the image to grayscale 
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) 
cv2.imshow('gray', gray) 

enter image description here

#----binarization of image 
ret,thresh = cv2.threshold(gray,250,255,cv2.THRESH_BINARY) 
cv2.imshow("thresh",thresh) 

enter image description here

#----performing adaptive thresholding 
athresh=cv2.adaptiveThreshold(thresh, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY_INV, 11, 2) 
cv2.imshow('athresh', athresh) 

enter image description here

kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(7, 7)) 

#----morphological operation 
closing = cv2.morphologyEx(athresh, cv2.MORPH_CLOSE, kernel) 
cv2.imshow('closing', closing) 

enter image description here

#----masking the obtained result on the grayscale image 
result = cv2.bitwise_and(gray, gray, mask= closing) 
cv2.imshow('result ', result) 

enter image description here