Community
cancel
Showing results for 
Search instead for 
Did you mean: 
serg
Beginner
239 Views

ippiMean_StdDev_8u_C3CR wrong result

Hello.

I has a suspicions of mean values from ippiMean_StdDev_8u_C3CR, and check it this way:

I've got different results  of R and mean1, G and mean2... why?

maean1 = 128.61, R = 122.70

mean2 = 122.69, G = 123.55

mean3 = 123.55, B = 128.61

image color order RGBRGBRGBRGB....

Ipp64f mean1, std1;
ippiMean_StdDev_8u_C3CR(m_pRGB, width4 * 3, roiSize4, 1, &mean1, &std1);
Ipp64f mean2, std2;
ippiMean_StdDev_8u_C3CR(m_pRGB, width4 * 3, roiSize4, 2, &mean2, &std2);
Ipp64f mean3, std3;
ippiMean_StdDev_8u_C3CR(m_pRGB, width4 * 3, roiSize4, 3, &mean3, &std3);

double R = 0; double G = 0; double B = 0;
{
BYTE* rgb = m_pRGB;
for (int y = 0; y < height4; y++)
{
for (int x = 0; x < width4; x++)
{
B += rgb[0];
R += rgb[1];
G += rgb[2];

rgb += 3;
}
}
}

R= R / (width4 * height4);
G= G / (width4 * height4);
B= B / (width4 * height4);

0 Kudos
1 Reply
serg
Beginner
232 Views

found error, please close topic:)

Reply