How to use regionprops in matlab?
2 次查看(过去 30 天)
显示 更早的评论
I have writen a code like this to calculate the mean intensity of my masked image, but it keeps having errors saying that 'regionprops' require Image Process Toolbox.
May I ask what went wrong with this code?
8 个评论
Walter Roberson
2019-11-24
This is what it should look like if you have the software installed:
>> ver('images')
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.7.0.1216025 (R2019b) Update 1
MATLAB License Number: XXXXXXX
Operating System: Mac OS X Version: 10.13.6 Build: 17G9016
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
Image Processing Toolbox Version 11.0 (R2019b)
If you do not see the Image Processing Toolbox line then you do not have the software installed.
In the command window click on Add-Ons -> Get Add-Ons . In the window that comes up ask to search for Image Processing Toolbox. Click on the first result. In the detailed page that comes up, over to the right hand side near the top, click on Install .
Note: you will be required to shut down MATLAB for the install to proceed.
采纳的回答
Image Analyst
2019-11-24
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
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!