Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Creating Historgams in a GUI (for color pixels and gray)

Subject: Creating Historgams in a GUI (for color pixels and gray)

From: Megan

Date: 24 Apr, 2013 19:39:09

Message: 1 of 2

I need to create 4 separate histograms in a GUI. I have the program set to load the original image ('myImage') and the convert it to gray ('myGrayAltered')

I've been trying to conquer the gray historgam first by adding
--
imhist(myGrayAltered,'Parent',handles.axesGrayHisto)
-- to my existing code. This brings up an error message of:

--
??? Error using ==> iptchecknargin at 77
Function IMHIST expected at most 2 input
arguments
but was called instead with 3 input arguments.

Error in ==> imhist>parse_inputs at 273
iptchecknargin(1,2,nargin,mfilename);

Error in ==> imhist at 57
[a, n, isScaled, top, map] =
parse_inputs(varargin{:});

Error in ==>
ImageManipulator>buttonConvert_Callback at 240
imhist(myGrayAltered,'Parent',handles.axesGrayHisto)

Error in ==> gui_mainfcn at 96
        feval(varargin{:});

Error in ==> ImageManipulator at 42
    gui_mainfcn(gui_State, varargin{:});

Error in ==>
@(hObject,eventdata)ImageManipulator('buttonConvert_Callback',hObject,eventdata,guidata(hObject))

 
??? Error while evaluating uicontrol Callback
--

would anyone be able to provide suggestion as to how to accomplish this? In addition an hints/suggestions on creating a histogram based on specific pixel values is appreciated

Subject: Creating Historgams in a GUI (for color pixels and gray)

From: Steven_Lord

Date: 24 Apr, 2013 21:04:51

Message: 2 of 2



"Megan " <mmsny9@mail.missouri.edu> wrote in message
news:kl9cct$a32$1@newscl01ah.mathworks.com...
> I need to create 4 separate histograms in a GUI. I have the program set to
> load the original image ('myImage') and the convert it to gray
> ('myGrayAltered')
>
> I've been trying to conquer the gray historgam first by adding --
> imhist(myGrayAltered,'Parent',handles.axesGrayHisto)

IMHIST doesn't support passing in arguments like 'Parent' and an axes on
which to parent the resulting graphics like some functions do.

http://www.mathworks.com/help/images/ref/imhist.html

What I think you will want to do is call IMHIST with two outputs then call
STEM, which DOES this parenting specification system, as described in the
blue Note box on that documentation page.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us