Я смущен использованием «горизонтального» и «вертикального» здесь < /p>
pixGetDimensions(pixd, &w, &h, &d);
< /code>
int vertical_part = h/divider;
int horizontal_part = w/divider;
< /code>
horizontal_parsed_pix_counts[horizontal_position*2][vertical_position] = left_count;
horizontal_parsed_pix_counts[(horizontal_position*2)+1][vertical_position] = right_count;
< /code>
// check for horizontal lines
for (int i = 0; (i < (divider*2)-1); i++) {
for (int j = 0; j < (divider-1); j++) {
int horizontal_sum = 0;
for (int x = 0; x < 2; x++) {
for (int y = 0; y < 2; y++) {
horizontal_sum += horizontal_parsed_pix_counts[i+x][j+y];
}
}
if (horizontal_sum >= hline_thresh) {
return 0;
}
}
}
< /code>
if divider = 2,
It will try horizontal_parsed_pix_counts[0,0]+horizontal_parsed_pix_counts[0,1]+horizontal_parsed_pix_counts[1,0]+horizontal_parsed_pix_counts[1,1]...
It corresponds to horizontal_position = 0,vertical_position=0 ;horizontal_position = 0,vertical_position=1.
Подробнее здесь: https://stackoverflow.com/questions/795 ... ertical-li