/* ------------------- */
void horiz_hist (unsigned char *ima, int n_row, int n_col)
{
long int h_hist[n_row];
printf("in horiz_hist \n");
int i, j, row_num, num_pixel=0;
for (i=0; i< n_row; i++) {
for (j=0; j< n_col; j++) {
if (ima[i* n_col+ j] ==0)
{
num_pixel++;
}
h_hist[i] =num_pixel;
}
num_pixel=0; /* reset the counter */
printf (" %5d%5d", i , h_hist[i]);
printf ( "\n");
}
/* ===============*/
}
to do :
use a 2d array to store the character pixels.
use mathlab/ octave to plot histograms
Keine Kommentare:
Kommentar veröffentlichen