简体   繁体   English

MATLAB图像处理技术

[英]MATLAB image processing technique

在此处输入图片说明

I have this 3D array in MATLAB (V: vertical, H: horizontal, t: time frame) 我在MATLAB中有3D数组(V:垂直,H:水平,t:时间范围)

Figures below represent images obtained using imagesc function after slicing the array in terms of t axis 下图表示将图像按t轴切片后使用imagesc函数获得的图像

在此处输入图片说明 在此处输入图片说明

area in black represents damage area and other area is intact 黑色区域表示损坏区域,其他区域完整

each frame looks similar but has different amplitude 每帧看起来相似但幅度不同

I am trying to visualize only defect area and get rid of intact area 我正在尝试仅可视化缺陷区域并摆脱完整区域

I tried to use 'threshold' method to get rid of intact area as below 我试图使用“阈值”方法来摆脱完整区域,如下所示

NewSet = zeros(450,450,200);

for kk = 1:200
    frame = uwpi(:,:,kk);
    STD = std(frame(:));
    Mean = mean(frame(:));
    for ii = 1:450
        for jj =1:450
            if frame(ii, jj) > 2*STD+Mean
                NewSet(ii, jj, kk) = frame(ii, jj);
            else 
                NewSet(ii, jj, kk) = NaN;            
            end           
        end
    end
end

However, since each frame has different amplitude, result becomes 但是,由于各帧的振幅不同,所以结果成为 在此处输入图片说明 在此处输入图片说明

Is there any image processing method to get rid of intact area in this case? 在这种情况下,是否有任何图像处理方法可以去除完整区域?

Thanks in advance 提前致谢

You're thresholding based on mean and standard deviation, basically assuming your data is normally distributed and looking for outliers. 您基于均值和标准差进行阈值确定,基本上是假设您的数据是正态分布的并且正在寻找离群值。 But your model should try to distinguish values around zero (noise) vs higher values. 但是您的模型应该尝试区分零(噪声)值和较高值之间的值。 Your data is not normally distributed, mean and standard deviation are not meaningful. 您的数据不是正态分布的,均值和标准差都没有意义。

Look up Otsu thresholding (MATLAB IP toolbox has it). 查找Otsu阈值(MATLAB IP工具箱已提供)。 It's model does not perfectly match your data, but it might give reasonable results. 它的模型不能完全匹配您的数据,但可能会给出合理的结果。 Like most threshold estimation algorithms, it uses the image's histogram to determine the optimal threshold given some model. 像大多数阈值估计算法一样,它使用图像的直方图确定给定模型的最佳阈值。

Ideally you'd model the background peak in the histogram. 理想情况下,您可以在直方图中对背景峰进行建模。 You can find the mode, fit a Gaussian around it, then cut off at 2 sigma. 您可以找到该模式,在其周围放一个高斯,然后以2 sigma的比例截止。 Or you can use the "triangle method", which finds the point along the histogram that is furthest from the line between the upper end of the histogram and the top of the background peak. 或者,您可以使用“三角法”,它沿着直方图找到距离直方图上端与背景峰顶部之间的线最远的点。 A little more complex to explain, but trivial to implement. 解释起来稍微复杂一点,但是实现起来却微不足道。 We have this implemented in DIPimage ( http://www.diplib.org ), M-file code is visible so you can see how it works (look for the function threshold ) 我们已经在DIPimage( http://www.diplib.org )中实现了此功能,M文件代码可见,因此您可以看到它的工作原理(查找功能threshold

Additionally, I'd suggest to get rid of the loops over x and y. 另外,我建议摆脱x和y上的循环。 You can type frame(frame<threshold) = nan , and then copy the whole frame back into NewSet in one operation. 您可以键入frame(frame<threshold) = nan ,然后通过一次操作将整个框架复制回NewSet中。

Do I clearly understand the question, ROI is the dark border and all it surrounds? 我是否清楚理解这个问题,ROI是深色边框及其周围的所有内容? If so I'd recommend process in 3D using some kind of region-growing technique like watershed or active snakes with markers by imregionalmin. 如果是这样的话,我建议您使用某种区域生长技术在3D中进行处理,例如分水岭或带有imregionalmin标记的活动蛇。 The methods should provide segmentation result even if the border has small holes. 即使边界上有小孔,该方法也应提供分割结果。 Than just copy segmented object to a new 3D array via logic indexing. 不仅仅是通过逻辑索引将分段的对象复制到新的3D数组中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM