/* implement the 'g' graphing command */ void do_graph1(csv_t *D, int col) { /* fix column number to match array indexing */ int array_col=col-1; row_buckets_t graph_buckets; int graph_values[GRAPHROWS] = {0}; /* determine the min and max of the column */ graph_buckets.min = find_min(D, array_col); graph_buckets.max = find_max(D, array_col); /* use the min and max to compute the size of the buckets */ graph_buckets.bucket_step_size = bucket_size(graph_buckets.max, graph_buckets.min, GRAPHROWS); /* fill an array of buckets, where the value of each index is the lower end of the bucket range */ row_bucket_values(&graph_buckets); /* fill an array determining how many values are in each bucket */ fill_buckets(&graph_buckets, D, array_col, graph_values); /* print the graph of bucket quantities per bucket value */ print_bucket_graph(&graph_buckets, D->labs[col-1], graph_values); }
void outlines_to_blobs( // find blobs BLOCK *block, // block to scan ICOORD bleft, ICOORD tright, C_OUTLINE_LIST *outlines) { // make buckets OL_BUCKETS buckets(bleft, tright); fill_buckets(outlines, &buckets); empty_buckets(block, &buckets); }