function [c, b, a] = qf2dcol(f,K)
% [c, b, a] = qf2dcol(f,K)
% Quadratic fit to columns of image f
% Produces c,b,a at every pixel for best fit parameters to:
%         cx^2 + b*x + a = y
[m n] = size(f);
k = round((K-1)/2);
c = zeros(m,n);
b = zeros(m,n);
a = zeros(m,n);
m2 = 0; 	m4 = 0;
for m1 = -k:k
  m2 = m2 + m1*m1;
  m4 = m4 + m1*m1*m1*m1;
end
for indexj = 1:n
%  if rem(indexj,10) == 0
%    indexj
%  end
  [at, bt, ct] = qf1d(f(:,indexj),K,m,k,m2,m4);
  for indexi = 1:m
    c(indexi,indexj) = ct(indexi);
    b(indexi,indexj) = bt(indexi);
    a(indexi,indexj) = at(indexi);
  end
end
