这样的for循环正确吗??
for (i=0;i<Height;i++){
TpPixelV = -1000;
ptr = (uchar*) (pImg->imageData + i * pImg->widthStep);
for (j=0;j<Width;j++)
{
Pixelv = (int)ptr[j];
if (Pixelv>TpPixelV)
{
TpPixelV = Pixelv;
MaxValueWith = j;
}
}
for (TpX=MaxValueWith-3;TpX<=MaxValueWith+3;TpX++)
{
TpPixelV = (int)ptr[TpX];
SumValue += TpPixelV;
EveryValue += (TpX)*TpPixelV;
}
RealMiddle = (double)EveryValue/((double)SumValue+0.00001);
TMaxValueWith = RealMiddle;
ptr[TMaxValueWith] = 255;
}