C ++高斯输出像素

时间:2014-04-06 02:53:39

标签: c++ gaussian

我需要使用C ++构建高斯滤波器。我成功地从图像中获取像素并构建两个网格;一个在中心的1和一个在角落的一个,我的问题是我不放弃了解高斯方程!我应该把什么放在我应该放在输出图像的像素?我该怎么办呢?我应该从修改后的网格(角落中的1个)或者什么来总结所有像素?

for ( int r = 0; r < rowCt; r++ ) 
    {
      for ( int c = 0; c < colCt; c++ ) 
      {
        getPixel ( r, c, onePix );// geting pixel from the Img
        int index = getIndex(r,c);// change colomns and rows to one dimentional array

        if(c <= (f/2) || c >= colCt-((f/2)-1)-1 || r >= rowCt-((r/2)-1)-1 || r <= ((r/2)-1)) 
          onePix = 0;// black if in the border
        else
        {
          .... // ??

          }
          outIm.setPixel ( r, c, outPut_Pixel);
        }
      }
    }

0 个答案:

没有答案