62 for (i = 1; i < size - 1; i++) {
63 for (p = i * size + 1, j = 1; j < size - 1; j++, p++) {
75 for (ni = 0; ni < 4; ni++) {
80 if ((((conv[p] > 0) && (conv[nbr[ni]] < 0)) ||
81 ((conv[p] < 0) && (conv[nbr[ni]] > 0))) &&
82 (fabs(conv[p]) < fabs(conv[nbr[ni]])) &&
83 (fabs(conv[p] - conv[nbr[ni]]) > thresh)) {
88 if (fabs(conv[nbr[1]] - conv[nbr[0]]) <
TINY) {
91 if (conv[nbr[2]] - conv[nbr[3]] < 0)
95 ang = atan2(conv[nbr[2]] - conv[nbr[3]],
96 conv[nbr[1]] - conv[nbr[0]]);
100 num_orients * ((ang + M_PI) / (M_PI * 2.0)) + 0.4999;
103 dir = (3 * num_orients / 4 + dir) % num_orients;
int G_math_findzc(double conv[], int size, double zc[], double thresh, int num_orients)
Finds locations and orientations of zero crossings.