How to translate this part of code to a pseudocode? thanks in advance

2 views (last 30 days)
I=imread('10arb_old.png');
[count11,x]=imhist(I(:,:,1));
I=imread('10arb_med.png');
[count21,x]=imhist(I(:,:,1));
I=imread('10arb_new.png');
[count31,x]=imhist(I(:,:,1));
count1=count11+count21+count31;
count=[count1 count2 count3];

Accepted Answer

Joseph Cheng
Joseph Cheng on 20 Jun 2014
for channels red, green and blue
read/load image 10arb_old.png
calculate histogram counts for each channel
store histogram counts as array count1x where x is channel number.
read/loadimage 10arb_med.png
store histogram counts as array count2x where x is channel number.
read/load image 10arb_new.png
store histogram counts as array count3x where x is channel number.
set count to array of sum of each corresponding channel.
  3 Comments
Mennat Allah Elsenousy
Mennat Allah Elsenousy on 20 Jun 2014
Sorry for inconvenience, but could you please help me with this part too..
for R=1:256
count1=count11+count21+count31; %sum of the 3 conditions count arrays of the first class count2=count12+count22+count32; %sum of the 3 conditions count arrays of the second class count3=count13+count23+count33; %sum of the 3 conditions count arrays of the third class
count=[count1 count2 count3]; m=3; n=3;
sum=0;
for j=1:m
mu(j)= count(R,j)/3;
sum=(sum+mu(j));
end
mu_bar=sum/m;
Image Analyst
Image Analyst on 21 Jun 2014
Correction : it's not doing it for red, green, and blue channels. It's histogramming only the red channel from the 3 different images.

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 20 Jun 2014
Just add comments. Those can be your pseudocode.

Community Treasure Hunt

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

Start Hunting!