I have several different histograms and I want to take as a result a final histogram. I am looking for a way to combine the different histograms and manage to make it one.

댓글 수: 1

jasche
jasche 2013년 1월 25일
how do you want to combine these images ? on what context ?

댓글을 달려면 로그인하십시오.

 채택된 답변

Image Analyst
Image Analyst 2013년 1월 25일

0 개 추천

As long as the bins cover the same ranges, you can simply add them. If they don't, then you'll have to align the ranges some how, which might mean taking the histograms again with histc and making sure all the bins are in the same places.

댓글 수: 6

Jenny
Jenny 2013년 1월 25일
Every histogram shows the frequency of white pixels of a photo on the vertical axis and the area (mm^2) on the horizontal axis, so the bins do not cover the same ranges because it depends on the maximum white pixel area of every photo.
Image Analyst
Image Analyst 2013년 1월 25일
So it's a particle size distribution. No problem - you can still specify the size range for each bin with histc(). It doesn't matter if some bins are bigger or smaller than what that particular image has because it will just create those bins as empty. But this is what you need to do to add the histograms together.
Jenny
Jenny 2013년 1월 25일
Thanks for your help ! :)
sweta arya
sweta arya 2016년 1월 8일
i=imread('138.jpg'); i=rgb2gray(i); size(i) binranges = 0:255; [bincounts] = histc(x,binranges); figure bar(binranges,bincounts,'histc') giving error in this code, Error using barV6 (line 13) Inputs must be 2-D.
Error in bar (line 47) h = barV6(cax, args{:});
sweta arya
sweta arya 2016년 1월 8일
편집: Image Analyst 2016년 1월 8일
i=imread('138.jpg');
i=rgb2gray(i);
size(i)
binranges = 0:255;
[bincounts] = histc(x,binranges);
figure
bar(binranges,bincounts,'histc')
giving error in this code,
Error using barV6 (line 13)
Inputs must be 2-D.
Error in bar (line 47)
h = barV6(cax, args{:});
Hello, what is the code for addition of different histograms
% Let's compute and display the histogram.
[pixelCount, grayLevels] = imhist(grayImage);
bar(grayLevels, pixelCount); % Plot it as a bar chart.
grid on;
title('Histogram of gray scale version of image', 'FontSize', fontSize, 'Interpreter', 'None');
xlabel('Gray Level', 'FontSize', fontSize);
ylabel('Pixel Count', 'FontSize', fontSize);
xlim([0 grayLevels(end)]); % Scale x axis manually.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Histograms에 대해 자세히 알아보기

질문:

2013년 1월 25일

댓글:

2016년 1월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by