- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
lyqmath 的博客
/lyqmath
lyqmath
/lyqmath
1 综述
Separating touching objects in an image is one of the more difficult image processing operations. The watershed
transform is often applied to this problem. The watershed transform finds catchment basins( 集水盆) and watershed
ridge lines( 山脊线) in an image by treating it as a surface where light pixels are high and dark pixels are low.
如果图像中的目标物体是连接在一起的,则分割起来会更困难,分水岭分割算法经常用于处理这类问题,通常
会取得比较好的效果。分水岭分割算法把图像看成一幅“地形图”,其中亮度比较强的区域像素值较大,而比较暗的
区域像素值较小,通过寻找“汇水盆地”和“分水岭界限”,对图像进行分割。
Segmentation using the watershed transform works better if you can identify, or mark, foreground objects and
background locations. Marker-controlled watershed segmentation follows this basic procedure:
直接应用分水岭分割算法的效果往往并不好,如果在图像中对前景对象和背景对象进行标注区别,再应用分水
岭算法会取得较好的分割效果。
基于标记控制的分水岭分割方法有以下基本步骤:
1. Compute a segmentation function. This is an image whose dark regions are the objects you are trying to segment.
1.计算分割函数。图像中较暗的区域是要分割的对象。
2. Compute foreground markers. These are connected blobs of pixels within each of the objects.
2.计算前景标志。这些是每个对象内部连接的斑点像素。
3. Compute background markers. These are pixels that are not part of any object.
3.计算背景标志。这些是不属于任何对象的像素。
4. Modify the segmentation function so that it only has minima at the foreground and background marker locations .
4.修改分割函数,使其仅在前景和后景标记位置有极小值。
1
5. Compute the watershed transform of the modified segmentation function.
5.对修改后的分割函数做分水岭变换计算。
Use by Matlab Image Processing Toolbox
使用MATLAB 图像处理工具箱
注:期间用到了很多图像处理工具箱的函数,例如fspecial 、imfilter、watershed、label2rgb、imopen、imclose、
imreconstruct、imcomplement 、imregionalmax、bwareaopen 、graythresh 和 imimposemin 函数等。
2 步骤
Step 1: Read in the Color Image and Convert it to Grayscale
第 1 步:读入彩色图像,将其转化成灰度图像
clc; clear all; close all;
rgb = imread(pears.png);
if ndims(rgb) == 3
I = rgb2gray(rgb);
else
文档评论(0)