MATLAB Answers

Why imhist do not run?

14 views (last 30 days)
matlab9000
matlab9000 on 22 Mar 2018
Answered: Image Analyst on 22 Mar 2018
This is the code:
img = imread('peppers.png');
imhist(img), grid;
Display error, why?

  1 Comment

Benjamin Kraus
Benjamin Kraus on 22 Mar 2018
What error?

Sign in to comment.

Answers (4)

Image Analyst
Image Analyst on 22 Mar 2018
Then post your complete error message - ALL THE RED TEXT.
And post the results of this (what do you see):
% Check that user has the specified Toolbox installed and licensed.
hasLicenseForToolbox = license('test', 'image_toolbox'); % license('test','Statistics_toolbox'), license('test','Signal_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 Comments

Sign in to comment.


Abhishek Ballaney
Abhishek Ballaney on 22 Mar 2018
https://www.mathworks.in/help/images/ref/imhist.html

  0 Comments

Sign in to comment.


Benjamin Kraus
Benjamin Kraus on 22 Mar 2018
imhist is part of the Image Processing Toolbox. Could the problem be that you do not have a license for the Image Processing Toolbox?

  0 Comments

Sign in to comment.


matlab9000
matlab9000 on 22 Mar 2018
No, it's a default image of Matlab

  0 Comments

Sign in to comment.

Sign in to answer this question.

Tags