/*
   * compute the second order.
   */
  bool harrisCorners::getSecondOrder(channel& gx,
                                     channel& gy,
                                     channel& fxy) const {

    const parameters& par = getParameters();

    fxy.resize(gx.size(),false,false);
    gaussKernel2D<float> gk(par.kernelSize,par.variance);
    convolution filter;
    convolution::parameters filterPar;
    filterPar.boundaryType = lti::Constant;
    filterPar.setKernel(gk);
    filter.setParameters(filterPar);

    channel::iterator igx=gx.begin();
    channel::iterator igxend=gx.end();
    channel::iterator igy=gy.begin();
    channel::iterator ifxy=fxy.begin();
    float tx, ty;

    while (igx!=igxend) {
      tx=(*igx);
      ty=(*igy);
      (*igx)=tx*tx;
      (*igy)=ty*ty;
      (*ifxy)=tx*ty;
      ++igx; ++igy; ++ifxy;
    }

    return (filter.apply(gx) && filter.apply(gy) && filter.apply(fxy));
  }