在均匀强度图像中检测物体 [英] detecting object in Homogeneous Intensity image

查看:16
本文介绍了在均匀强度图像中检测物体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Tiger's Pugmark(足迹印象)在泥土中的图像.我想检测 pugmark 的边界,但图像的强度是均匀的,即前景和背景无法根据强度变化来区分.我能做些什么来区分 pugmark 和背景.!

I have image of Tiger's Pugmark (footprint impression) in mud. I want to detect the boundary of the pugmark but the image is uniform in intensity that is foreground and background cannot be distinguished based on intensity variations. What can i do to distinguish between the pugmark and the background.!

推荐答案

在分割任务中,如果你有两个

In segmentation tasks if you have both

  1. 良好的标记;和
  2. 感兴趣的对象周围有明显的边缘

然后它直接通过分水岭变换解决.当然,问题在于获得这些标记,以及根据需要增强相关边缘.获取这些可能涉及特定问题的知识,而我没有针对您的问题的知识.

then it is directly solved by a Watershed Transform. The problem, of course, is obtaining these markers, as well enhancing relevant edges as needed. Obtaining these might involve problem-specific knowledge, which I don't have for your problem.

不过,有一些通用方法可能有用.例如,数学形态学中的连接算子可用作合并和扩展平坦区域的一种方式.因此,也许它可以为我们提供相对较好的问题标记.在下图中,在原始图像(左图)的灰度版本中,通过开运算(一种连通算子)进行形态学重建,剩余的区域最大值显示在右图.

Nevertheless, there are some general methods that might be useful. For instance, connected operators from Mathematical Morphology serve as a way to merge and extend flat zones. Thus, maybe it can give us relatively good markers for the problem. In the following image a morphological reconstruction by opening (a kind of connected operator) was performed in the grayscale version of the original image (left image), and the remaining regional maximum is shown at right.

现在,我们可以得到上图左图的形态梯度.我们还可以在上图中用一个小圆盘进行空洞填充和膨胀,以获得更平滑的轮廓——这定义了我们的标记图像.然后,使用我们的标记图像在渐变图像中应用分水岭变换,然后扩展(侵蚀或扩张,取决于你如何看待它)分水岭线,我们得到以下图像:

Now, we can obtain the morphological gradient of the left image above. We can also do hole filling and a dilation with a small disk in the right image above to obtain more smooth contours -- this defines our marker image. Then, applying a Watershed Transform in the gradient image using our marker image, and then expanding (erode or dilate, depends on how you see it) the watershed lines, we get the following image:

我怀疑您可以轻松丢弃太大和太小的区域.然后,如果您对爪子和手掌有一些粗略的预期尺寸,您可以丢弃不相关的区域.此时只需将区域扩大以形成单个组件并在原始图像中显示生成的轮廓:

I suspect that you can discard too large and too small regions easily. Then, if you have some rough expected sizes for the claws, as well for the palm, you can discard the irrelevant regions. At this point it is only a matter of dilating the areas to form a single component and show the resulting contour in the original image:

执行每个步骤的示例代码(相关步骤也显示在注释的 Matlab 代码中):

Sample code for performing each step (the relevant steps are also shown in commented Matlab code):

f = Import["http://imageshack.us/a/img407/4636/p1060993g.jpg"]
g = ColorConvert[f, "Grayscale"]                           (* g = rgb2gray(f); *)
(* First image shown: *)
geo = GeodesicOpening[g, DiskMatrix[5]]  (* geo = imreconstruct(imerode(g, ... *)
                                         (*         strel('disk', 6)), g);     *)
(* Second image shown: *)
marker = MaxDetect[geo]                        (* marker = imregionalmax(geo); *)

(* Watershed on gradient with markers. *)
mgrad = ImageSubtract[Dilation[geo, 1], Erosion[geo, 1]]; (* mgrad = ...       *)
          (* imdilate(geo,strel('square',3)) - imerode(geo,strel('square',3)); *)
ws = Image[           (* ws = watershed(imimposemin(mgrad, bwmorph(imfill(...  *)
 WatershedComponents[mgrad,      (* imregionalmax(geo),'holes'),'dilate'))));  *)
  Dilation[FillingTransform[marker], DiskMatrix[1]]]]

(* Third image shown: *)
wsthick = Erosion[ws // ImageAdjust, DiskMatrix[5]]

(* Connected component selection based on some supposed sizes. *)
ccs = SelectComponents[wsthick, "Count", 1000 < # < 3000 || 6000 < # < 10000 &]

(* Final image (thick border on binarized filled dilated ccs) *)
res = ImageAdd[f, Dilation[MorphologicalPerimeter[FillingTransform[
     MorphologicalPerimeter[Dilation[ccs, DiskMatrix[9]]]]], 2]]

这篇关于在均匀强度图像中检测物体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆