"Undefined function or variable 'drawfreehand'." All ROI functions don't work.

3 views (last 30 days)
When I try any sort of ROI(region of interest) function such as h = drawfreehand, after opening up an image like the examples I saw, it says "Undefined function or variable 'drawfreehand'." Why does it appear that I cannot use any of these functions. I have Image processing toolbox installed, and I'm using Matlab R2018a
im = imread('ex.png');
>> imshow(im)
>> h = drawassisted;
% Undefined function or variable 'drawassisted'.

Accepted Answer

Walter Roberson
Walter Roberson on 11 Jul 2019
Needs R2018b

More Answers (2)

Adam Danz
Adam Danz on 11 Jul 2019
Edited: Adam Danz on 11 Jul 2019
You probably don't have the toolbox function on your matlab path. Go to the primary folder where the toolbox functions are stored, copy the path and then add that path and all subfolders to the matlab path.
For example,
addpath(genpath('C:\Users\name\Documents\MATLAB\toolboxes\ROI'))
  3 Comments
Adam Danz
Adam Danz on 12 Jul 2019
It looks like those function are part of the Image Processing Toolbox listed here:
Are you sure you have that toolbox? Are you able to download the toolbox again?

Sign in to comment.


Image Analyst
Image Analyst on 11 Jul 2019
Try this:
>> which -all drawassisted
You should see:
C:\Program Files\MATLAB\R2019a\toolbox\images\imuitools\drawassisted.m
Then try this:
% Check that user has the specified Toolbox installed and licensed.
hasLicenseForToolbox = license('test', 'image_toolbox'); % Check for Image Processing Toolbox.
% hasLicenseForToolbox = license('test','Statistics_toolbox'); % Check for Statistics and Machine Learning Toolbox.
% hasLicenseForToolbox = license('test','Signal_toolbox'); % Check for Signal Processing Toolbox.
% hasLicenseForToolbox = license('test', 'video_and_image_blockset'); % Check for Computer Vision System Toolbox.
if ~hasLicenseForToolbox
% User does not have the toolbox installed, or if it is, there is no available license for it.
% For example, there is a pool of 10 licenses and all 10 have been checked out by other people already.
ver % List what toolboxes the user has licenses available for.
message = sprintf('Sorry, but you do not seem to have the Image Processing Toolbox.\nDo you want to try to continue anyway?');
reply = questdlg(message, 'Toolbox missing', 'Yes', 'No', 'Yes');
if strcmpi(reply, 'No')
% User said No, so exit.
return;
end
end
What do you observe?

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!