Example #1
0
int result_handle(void* data,int n_columns,char** column_values,char** column_names)
{
    static int column_names_printed = 0;
    //int i;
    if (!column_names_printed)
    {
        one_row(n_columns, column_names);
        column_names_printed = 1;
    }

    one_row(n_columns, column_values);
    return 0;
}
Example #2
0
static void generateRotatedPatterns(const int& patch_size,
									const int& kNumAngles,
                                    std::vector<std::vector<std::vector<int> > >& rotatedX,
                                    std::vector<std::vector<std::vector<int> > >& rotatedY)
{
	int win_offset = (patch_size-1)/2;
	for (int i = 0; i < kNumAngles; i++)
	{
        std::vector<std::vector<int> > mappedX, mappedY;
		for(int m = 0; m < patch_size; m++){
            std::vector<int> one_row(patch_size);
			mappedX.push_back(one_row);
			mappedY.push_back(one_row);
		}
		float descriptor_dir = (float)(i * 2* CV_PI/ 30);
		float sin_dir = sin(descriptor_dir);
		float cos_dir = cos(descriptor_dir);
		int a, b; a = 0;
		for(int m = win_offset; m >= -win_offset; m--, a++){
			b = 0;
			for(int n = -win_offset; n <= win_offset; n++, b++){
				float pixel_x = n*cos_dir + m*sin_dir;
				float pixel_y = -n*sin_dir + m*cos_dir;

				int x = cvRound(pixel_x);
				int y = cvRound(pixel_y);

				mappedX[a][b] = x;
				mappedY[a][b] = y;
			}
		}
		rotatedX.push_back(mappedX);
		rotatedY.push_back(mappedY);
	}
}
Example #3
0
void append_row(const vector<mpq_class> row, map <Type::InputType, vector< vector<mpq_class> > >& input_map,
                    Type::InputType input_type) {
    
    vector<vector<mpq_class> > one_row(1,row);
    save_matrix(input_map,input_type,one_row); 
}