找回密码
 注册
Simdroid-非首页
楼主: wanglegend

MATLAB进行图像分割问题

[复制链接]
发表于 2005-10-31 13:25:35 | 显示全部楼层 来自 湖北武汉

Re:MATLAB进行图像分割问题

你的版本不是7.0的吧,很多函数没有。

help imregionalmin
IMREGIONALMIN Compute regional minima of I.
    BW = IMREGIONALMIN(I) computes the regional minima of I.  The output
    binary image BW has value 1 corresponding to the pixels of I that belong
    to regional minima and 0 otherwise.  BW is the same size as I.

    Regional minima are connected components of pixels with the same
    intensity value, t, whose external boundary pixels all have a value
    greater than t.

    By default, IMREGIONALMIN uses 8-connected neighborhoods for 2-D
    images and 26-connected neighborhoods for 3-D images.  For higher
    dimensions, IMREGIONALMIN uses CONNDEF(NDIMS(I),'maximal').

    BW = IMREGIONALMIN(I,CONN) computes the regional minima of I using
    the specified connectivity.  CONN may have the following scalar
    values:

    BW = IMREGIONALMIN(I,CONN) computes the regional minima using the
    specified connectivity.  CONN may have the following scalar values:

        4     two-dimensional four-connected neighborhood
        8     two-dimensional eight-connected neighborhood
        6     three-dimensional six-connected neighborhood
        18    three-dimensional 18-connected neighborhood
        26    three-dimensional 26-connected neighborhood

    Connectivity may be defined in a more general way for any dimension by
    using for CONN a 3-by-3-by- ... -by-3 matrix of 0s and 1s.  The 1-valued
    elements define neighborhood locations relative to the center element of
    CONN.  CONN must be symmetric about its center element.

    Class support
    -------------
    I can be of any nonsparse numeric class and any dimension.  BW is
    always logical.

    Example
    -------
        A = 10*ones(10,10);
        A(2:4,2:4) = 3;       % minima 3 lower than surround
        A(6:8,6:8) = 8        % minima 8 lower than surround
        regmin = imregionalmin(A)

    See also conndef, imimposemin, imreconstruct, imregionalmax.

    Reference page in Help browser
       doc imregionalmin
 楼主| 发表于 2005-11-5 01:41:42 | 显示全部楼层 来自 清华大学紫荆公寓

Re:MATLAB进行图像分割问题

Simdroid开发平台
做了几天GUI,感觉其中的参数传递实在是太让人晕了。能找到的例子都是贼让人晕的。刚刚把处理单张照片的部分做出来。几乎是改gui自带的第一个例子做的。贴上来算是新手给以后的新新手借鉴用的吧。(还没做完,但是可以运行了,做完了再贴)
但是有几个很不好意思的问题:
处理出来的图片本来应该是黑白的啊,怎么是蓝底了?
谢谢!
非常感谢alexqxp一直一来的帮助!^_^

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
 楼主| 发表于 2005-11-5 01:42:10 | 显示全部楼层 来自 清华大学紫荆公寓

Re:MATLAB进行图像分割问题

fig文件

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
 楼主| 发表于 2005-11-5 01:43:29 | 显示全部楼层 来自 清华大学紫荆公寓

Re:MATLAB进行图像分割问题

m文件

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
 楼主| 发表于 2005-11-5 16:46:04 | 显示全部楼层 来自 山东聊城

Re:MATLAB进行图像分割问题

请问:
我做的软件需要在GUI中,能让摄像头定时拍摄照片,并存到一个文件夹下,还要进行整个文件夹图像的处理。但是我的硬件基础非常薄弱,看了前面的帖子,再加上help中的Data Acquisition Toolbox还是不太明白,能介绍一下怎样实现摄像头的定时拍照、存储吗?还有就是整个文件夹的导入,我看了很多书,但很少有介绍这种基本操作的内容,很惭愧。
不胜感激!
发表于 2005-11-7 14:19:11 | 显示全部楼层 来自 湖北武汉

Re:MATLAB进行图像分割问题

first see these:
http://www.simwe.com/forum/viewthread.php?tid=617090
http://www.simwe.com/forum/viewthread.php?tid=606884

处理出来的图片本来应该是黑白的啊,怎么是蓝底了?
加上
colormap(gray)
发表于 2006-2-10 10:44:49 | 显示全部楼层 来自 黑龙江哈尔滨

Re:请问有人用过MATLAB进行图像处理吗

wanglegend wrote:

        现在的问题是,这样取mask能否在matlab中实现,我做的例子用椭圆截取,条件放宽一些,如果我给定原始图片中一个矩形的四个角点坐标,能否只取出这个矩形内的图像,而删除周围所有的象素,并且只保存该矩形内的图像。因为如附图所示,虽然周围图像没了,却仍然留下了大片空白,怎样只留中间的那个矩形呢?
        望高手指点!

先把你的图片用MATLAB中图形函数转成分别表示各象素点的三维矩阵(JPEG图形是可以转的,其他的没试),设定好选取矩形区域四个角点的坐标,将这些坐标转成对应象素点位置,即象素点对应三维矩阵的第一、二维下标值,然后然后把矩阵中对应部分赋值给新的矩阵并另转存成图片就行了。

下面是我以前发的一个好玩的帖子,有些地方可以供你参考一下,如果你只需要简单的裁减成矩形,可以看看"imcrop"命令,好像前面有人说过了。
http://www.simwe.com/forum/viewthread.php?tid=634471
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-4-28 08:12 , Processed in 0.033348 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表