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:
how to extract and save data from histogram

Subject: how to extract and save data from histogram

From: Wan Nurul Wahidah Wan Mustaffa Fikri

Date: 4 Nov, 2012 18:05:09

Message: 1 of 2

I already plotted the histogram from my image after convert it to grayscale mode by using 'rgb2gray' and 'imhist' function. The x-axis refer to 'Intensity Value' and y-axis refer to 'Distribution of Pixel'.
The problem now is, how do I extract and save data from histogram into a table which can display both data of x-axis and y-axis? Which function should i use? Please help me..

Subject: how to extract and save data from histogram

From: Don

Date: 5 Nov, 2012 02:53:09

Message: 2 of 2

"Wan Nurul Wahidah Wan Mustaffa Fikri" wrote in message <k76aol$8e1$1@newscl01ah.mathworks.com>...
> I already plotted the histogram from my image after convert it to grayscale mode by using 'rgb2gray' and 'imhist' function. The x-axis refer to 'Intensity Value' and y-axis refer to 'Distribution of Pixel'.
> The problem now is, how do I extract and save data from histogram into a table which can display both data of x-axis and y-axis? Which function should i use? Please help me..

while the hist figure is open:

xdata = get(findobj(gcf,'type','patch'),'xdata');
ydata = get(findobj(gcf,'type','patch'),'ydata');

don.

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