简体   繁体   中英

Combining different histogram into one Matlab

I am working on facial images, I have different image patches I already calculated the histogram for each patch, now I want to combine all patches histogram into one histogram, I am trying the following code which is given below, but I am not getting right histogram, please help.

P1 = imhist(uint8(patch1));
P2 = imhist(uint8(patch2));
p3 = imhist(uint8(patch3));
P4 = imhist(uint8(patch4));
P5 = imhist(uint8(patch5));
P6 = imhist(uint8(patch6));
P7 = imhist(uint8(patch7));
P8 = imhist(uint8(patch8));
masterHist=[P1,P2,P3,P4,P5,P6,P7,P8];
[final, GLd] = imhist(uint8(masterHist));
subplot();
bar(GLd, final);
title('Histogram of Local Binary Pattern Final', 'FontSize', 14);

After running the above code I got this histogram which is incorrect. 在此处输入图片说明

The problem with your code is, you are taking the histogram of a histograms, resulting in more or less meaningless data. masterHist already contains the data you want to plot.

bar(masterHist)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM