Problem with 'colorkmeans(...)'

341 views
Skip to first unread message

Thomas Templin

unread,
Oct 13, 2018, 3:48:18 PM10/13/18
to Robotics & Machine Visio.
Dear Group:

I installed the VLFeat MATLAB toolbox (v. 0.9.21).

When running colorkmeans(im_targets, 2, 'ab'), as given on p. 420 of the 2nd edition of the textbook, I receive the message "Error using vl_kmeans. Unknown option 'ab'."

I'd like to ask the group if anyone has managed to get this function to work and what changes are required to achieve this.

Thanks a lot for any help with this issue!

Thomas

thomas....@gmail.com

unread,
Oct 18, 2018, 3:01:08 PM10/18/18
to Robotics & Machine Vision Toolboxes
I figured it out. It has to be 'Lab', not 'ab'. The argument 'ab' is used in the function showcolorspace.

Peter Corke

unread,
Nov 10, 2018, 6:22:14 PM11/10/18
to Robotics & Machine Vision Toolboxes
Hi Thomas,

for me the command works with 'ab' or 'Lab'.  Can you tell me what version of MVTB you are using, use ver or rvccheck.

This issue is independent of vl_feat.

peter

Thomas Templin

unread,
Dec 2, 2018, 11:16:44 AM12/2/18
to robotics...@googlegroups.com
Thanks, Peter!

Here's the result:

>> rvccheck
You are using:
 - MATLAB release 2017b
 - Robotics Toolbox for MATLAB 10.3 19-Aug-2018 [mltbx install]
 - Machine Vision Toolbox 4.3.0 2018-03-11 [Toolbox install]
** Toolbox function rotx is shadowed by C:\Program Files\MATLAB\R2017b\toolbox\phased\phased\rotx.m
** Toolbox function roty is shadowed by C:\Program Files\MATLAB\R2017b\toolbox\phased\phased\roty.m
** Toolbox function rotz is shadowed by C:\Program Files\MATLAB\R2017b\toolbox\phased\phased\rotz.m
** Toolbox function angdiff is shadowed by C:\Program Files\MATLAB\R2017b\toolbox\robotics\robotcore\angdiff.m
** Toolbox function im2col is shadowed by C:\Program Files\MATLAB\R2017b\toolbox\images\images\im2col.m
** Toolbox function col2im is shadowed by C:\Program Files\MATLAB\R2017b\toolbox\images\images\col2im.m
** Toolbox function angdiff is shadowed by C:\Program Files\MATLAB\R2017b\toolbox\robotics\robotcore\angdiff.m
Some Toolbox files are "shadowed" and will cause problems with the use of this toolbox
Use path tool to move this Toolbox to the top of the path

--
You received this message because you are subscribed to the Google Groups "Robotics & Machine Vision Toolboxes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotics-tool-...@googlegroups.com.
To post to this group, send email to robotics...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotics-tool-box.
For more options, visit https://groups.google.com/d/optout.

Peter Corke

unread,
Dec 2, 2018, 4:09:35 PM12/2/18
to robotics...@googlegroups.com
OK, there’s some bad path stuff going on.  Can you use path tool to either remove (or move to the bottom of the list) all paths related to phased, images and robotics.  You know you are done when rvccheck no longer gives those “shadowed” warnings.



You received this message because you are subscribed to a topic in the Google Groups "Robotics & Machine Vision Toolboxes" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/robotics-tool-box/XcjpKJUmWyU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to robotics-tool-...@googlegroups.com.

Kainat Mirza

unread,
May 1, 2020, 6:21:23 PM5/1/20
to Robotics & Machine Vision Toolboxes
>> rvccheck
You are using:
 - MATLAB release 2018b
     ** this is at least 2 years old, you may have issues
 - Machine Vision Toolbox 4.3.0 2018-03-11 [mltbx install to Add-Ons]
** Toolbox function im2col is shadowed by C:\Program Files\MATLAB\R2018b\toolbox\images\images\im2col.m
** Toolbox function col2im is shadowed by C:\Program Files\MATLAB\R2018b\toolbox\images\images\col2im.m
** Toolbox function angdiff is shadowed by C:\Program Files\MATLAB\R2018b\toolbox\robotics\robotcore\angdiff.m
Some Toolbox files are "shadowed" and will cause problems with the use of this toolbox
Use path tool to move this Toolbox to the top of the path
>> rvccheck
You are using:
 - MATLAB release 2018b
     ** this is at least 2 years old, you may have issues
 - Machine Vision Toolbox 4.3.0 2018-03-11 [mltbx install to Add-Ons]
Attempt to execute SCRIPT closest as a function:
C:\Users\hp\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\Machine Vision Toolbox for MATLAB\vision\closest.m

Error in kmeans (line 139)
        s = closest(x, z);

Error in colorkmeans (line 102)
            [L,C,resid] = kmeans([x y]', k, varargin{:});

Error in feature_extraction (line 35)
[cls, cab,resid] = colorkmeans(targets, 2,'ab');

Attempt to execute SCRIPT closest as a function:
C:\Users\hp\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\Machine Vision Toolbox for MATLAB\vision\closest.m

Error in kmeans (line 139)
        s = closest(x, z);

Error in colorkmeans (line 102)
            [L,C,resid] = kmeans([x y]', k, varargin{:});

Error in feature_extraction (line 35)
[cls, cab,resid] = colorkmeans(targets, 2,'Lab');

Error using  ' 
Transpose on ND array is not defined. Use PERMUTE instead.

Error in feature_extraction (line 35)
[cls, cab,resid] = colorkmeans(targets', 2,'Lab');

Attempt to execute SCRIPT closest as a function:
C:\Users\hp\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\Machine Vision Toolbox for MATLAB\vision\closest.m

Error in kmeans (line 139)
        s = closest(x, z);

Error in colorkmeans (line 102)
            [L,C,resid] = kmeans([x y]', k, varargin{:});

Error in feature_extraction (line 35)
[cls, cab,resid] = colorkmeans(targets, 2,'Lab');

Help me solve it.

Peter Corke

unread,
May 2, 2020, 6:44:45 PM5/2/20
to Robotics & Machine Vision Toolboxes
Hi Kainat,

more detail is always helpful.  It's not clear why 2 runs of rvccheck give different answers, nor how the error messages came to be.  Always happy to help, I just need information. 

kainatm...@gmail.com

unread,
May 3, 2020, 2:10:24 PM5/3/20
to robotics...@googlegroups.com

I was running this code

targets = iread('yellowtargets.png');

garden = iread('tomato_124.jpg');

[cls, cab,resid] = colorkmeans(targets, 2,'ab');

%We can plot these cluster centers on the a*b*-plane

showcolorspace(cab, 'ab');

 

then I followed your instructions on shadow toolbox functions. Then I checked rvccheck. It was resolved. But still I can’t make it work.

Regargs,

Kainat Saeed

 

Sent from Mail for Windows 10

--

You received this message because you are subscribed to a topic in the Google Groups "Robotics & Machine Vision Toolboxes" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/robotics-tool-box/XcjpKJUmWyU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to robotics-tool-...@googlegroups.com.

Peter Corke

unread,
May 9, 2020, 6:33:54 PM5/9/20
to Robotics & Machine Vision Toolboxes
How about you send me one clear code example with whatever it is that doesn't work.  You need to help me to help you.  Take the time to carefully explain what is going wrong.

To unsubscribe from this group and all its topics, send an email to robotics-tool-box+unsubscribe@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages