Skip to content

Instantly share code, notes, and snippets.

void DImage::deskew(string filename, unsigned int angle)
{
if (filename == "")
return;
std::cout << "Being called with filename " << filename << std::endl;
Mat img = imread(filename, CV_LOAD_IMAGE_GRAYSCALE);
@dantswain
dantswain / QuadraticForm
Created December 3, 2011 21:50
Quadratic form in c
for(i = 0; i < n_rows; i++)
{
tmp = 0;
for(j = i + 1; j < n_rows; j++)
{
tmp += prA[i*n_rows + j]*prX[j];
}
y += prX[i]*2.0*tmp;
y += prX[i]*prX[i]*prA[i*n_rows + i];
}