I am trying to use the function imfill() but it does not run and the following message is displayed: Undefined function or variable 'eml_asser​t_all_cons​tant'. I can't find such fuction in MATLAB documentation.

6 views (last 30 days)
Error message:
------------------
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);
Error in calcQUALMETRICS_funV2 (line 33)
nimg=imfill(tmp1,'holes');
  2 Comments
Ryan Livingston
Ryan Livingston on 5 Jan 2016
It looks like something may be wrong with the MATLAB path. Are you trying to use MATLAB Coder?
  1. What is the output of: which imreconstruct?
  2. What is the output of: which iptcheckconn?

Sign in to comment.

Answers (2)

Kenneth Eaton
Kenneth Eaton on 28 Aug 2017
If you use the function which like so:
which iptcheckconn -all
You will probably see two paths show up:
C:\Program Files\MATLAB\(Your_version)\toolbox\images\images\eml
C:\Program Files\MATLAB\(Your_version)\toolbox\images\iptutils
Your problem is likely 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.
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:
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.

Henrique Sergio Gutierrez da Costa
Edited: Walter Roberson on 18 Dec 2015
Hi Walter,
follows the answers:
size(tmp1) = 112 90
class(tmp1) = logical (it´s a BW image)
nnz(tmp1) = 7129
Thanks.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!