【问题标题】:Improving Low Contrast Image Segmentation改善低对比度图像分割
【发布时间】:2016-11-30 09:44:11
【问题描述】:

我有需要分割的相差显微镜图像。由于背景中的对象之间缺乏对比,似乎很难分割它们(图 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 - 原始图像 histogramEq - 增加可见性图像 binaryImage - 二值化图像

【问题讨论】:

    标签: matlab image-processing image-segmentation contrast


    【解决方案1】:

    在应用阈值之前,我会使用白色礼帽将不同的图案与背景分开。见here the result。那你stretch the histogram

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

    【讨论】:

    • 嗨,我在histogramEq 之后添加了tophatImage = imtophat(histogramEq,strel('disk',7)) 行。结果看起来与您的非常相似,但不同之处在于,与您的背景相比,感兴趣的对象看起来更亮。你是如何使感兴趣的物体变亮的? stretching the histogram 是什么意思?
    • 我的建议是在adapthisteq之前戴上礼帽,而不是之后。礼帽对照明变化不敏感。我添加了一个关于直方图拉伸的链接。
    • 它似乎仍然没有帮助准确的分割。
    • 你能分享你在 top-hat+ histogramEq 之后的图像吗?
    【解决方案2】:

    我想以 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)
    

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

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

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

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

    【讨论】:

      猜你喜欢
      • 2015-02-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-26
      • 2016-03-30
      • 1970-01-01
      • 2020-12-16
      • 2012-11-04
      • 1970-01-01
      相关资源
      最近更新 更多