58 for (i = 1; i < size - 1; i++) {
59 for (p = i * size + 1, j = 1; j < size - 1; j++, p++) {
71 for (ni = 0; ni < 4; ni++) {
76 if ((((conv[p] > 0) && (conv[nbr[ni]] < 0)) ||
77 ((conv[p] < 0) && (conv[nbr[ni]] > 0))) &&
78 (fabs(conv[p]) < fabs(conv[nbr[ni]])) &&
79 (fabs(conv[p] - conv[nbr[ni]]) > thresh)) {
84 if (fabs(conv[nbr[1]] - conv[nbr[0]]) <
TINY) {
87 if (conv[nbr[2]] - conv[nbr[3]] < 0)
91 ang = atan2(conv[nbr[2]] - conv[nbr[3]],
92 conv[nbr[1]] - conv[nbr[0]]);
95 dir = num_orients * ((ang +
M_PI) / (
M_PI * 2.0)) + 0.4999;
98 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.