MATLAB的函数imfill()会导致错误 [英] MATLAB's function imfill() causes error

查看:743
本文介绍了MATLAB的函数imfill()会导致错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个二进制图像(720x1280逻辑),其中有一些漏洞,所以我使用 imfill 来填充它,但是操作失败了,我得到了以下错误:

I have a binary image (720x1280 logical) that has some holes in it, so I'm using imfill to fill it up, however the action fails and I get the following error:

Undefined function or variable 'eml_assert_all_constant'.
Error in iptcheckconn (line 8)
eml_assert_all_constant(varargin{:});
Error in imreconstruct>parseInputs (line 136)
    iptcheckconn(varargin{3},mfilename,'CONN',3);
Error in imreconstruct (line 74)
[marker,mask,conn] = parseInputs(varargin{:});
Error in imfill (line 141)
    I2 = imreconstruct(marker, mask, conn);

我检查过其他资源,他们建议文件 imreconstruct iptcheckconn 可能不存在,但确实如此。
关于如何解决的任何想法?

I've checked other resources, and they suggested that the files imreconstruct and iptcheckconn might not exist, but they do. Any ideas on how to solve?

推荐答案

如评论中所示,使用 哪个 显示文件的位置 iptcheckconn 被召唤。 -all 选项显示有两个版本,在R2016a中显示在这些文件夹中:

As shown in the comments, using which shows you the location of the file iptcheckconn that gets called. The -all option shows you that there are two versions, showing up in these folders for you in R2016a:

C:\Program Files\MATLAB\R2016a\toolbox\images\images\eml
C:\Program Files\MATLAB\R2016a\toolbox\images\iptutils

对我来说,在R2016b中,我只看到一个出现在 iptutils 文件夹。您的问题似乎是您在图像处理工具箱中添加了一些子文件夹到您的 MATLAB路径,即使它们通常不应该。 eml 文件夹没有出现在我的MATLAB路径上,我认为它通常不应该出现。我在安装过程中看到过这样的问题。

For me, in R2016b, I only see one showing up in the iptutils folder. Your problem appears to be that you have some subfolders in the Image Processing Toolbox that have been added to your MATLAB path even though they normally shouldn't be. The eml folder does not appear on my MATLAB path, and I don't think it's normally supposed to. I've seen issues like this sometimes appear during installation.

第一个文件夹中 iptcheckconn 的版本是阴影您真正想要在第二个文件夹中使用的版本。您需要删除路径中的第一个文件夹,以便MATLAB使用正确的。或者,您也可以将该文件夹保留在路径中,但只需将其向下移动在路径列表中,以便在第二个文件夹后显示。从文档:

The version of iptcheckconn in the first folder is shadowing the version you really want to use in the second folder. You'll want to remove the first folder from the path so MATLAB uses the correct one. Alternatively, you could also leave that folder on the path but just move it down on the path list so it shows up after the second folder. From the documentation:


当搜索路径上的多个文件夹中出现具有相同名称的文件时,MATLAB使用在最近的文件夹中找到的文件到搜索路径的顶部。

When files with the same name appear in multiple folders on the search path, MATLAB uses the one found in the folder nearest to the top of the search path.

这篇关于MATLAB的函数imfill()会导致错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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