Question

I have two matrixesthat belongs gaussian distribtion.The size are 3x3. Now, I want to estimate up and down threshold of their matrixes. I denote mean and standard deviation of each matrix is μ1;μ2 and σ1;σ2. The high and low threshold are

T_hight=(μ1+μ2)./2+k1∗(σ1+σ2)./2

T_low=(μ1+μ2)./2-k2∗(σ1+σ2)./2

where k1,k2 is const

My question is "Is my formula correct? Because this is gaussian distribution, so k1=k2,Right? And this is my code. Could you check have me"

μ1=mean(v1(:));first matrix 
σ1=std2(v1(:));
μ2=mean(v2(:));second matrix 
σ2=std2(v2(:));
k1=k2=1; 
T_hight=(μ1+μ2)./2+k1∗(σ1+σ2)./2;
T_low=(μ1+μ2)./2-k2∗(σ1+σ2)./2;
Was it helpful?

Solution

In the formula you are using, the joint standard deviation is wrong.it should be

T_high=(μ1+μ2)./2+k1∗sqrt((σ1^2+σ2^2)/2);
T_low=(μ1+μ2)./2-k2∗sqrt((σ1^2+σ2^2)/2);

As you treat all 18 pixels as belonging to the same distribution, why not use the following

v=[v1(:);v2(:)];
μ=mean(v); 
σ=std(v);
k1=k2=1; 
T_high=μ+k1*σ;
T_low=μ-k2∗σ1;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top