59 for (i = 1; i < size - 1; i++) {
60 for (p = i * size + 1, j = 1; j < size - 1; j++, p++) {
72 for (ni = 0; ni < 4; ni++) {
77 if ((((conv[p] > 0) && (conv[nbr[ni]] < 0)) ||
78 ((conv[p] < 0) && (conv[nbr[ni]] > 0))) &&
79 (fabs(conv[p]) < fabs(conv[nbr[ni]])) &&
80 (fabs(conv[p] - conv[nbr[ni]]) > thresh)) {
85 if (fabs(conv[nbr[1]] - conv[nbr[0]]) <
TINY) {
88 if (conv[nbr[2]] - conv[nbr[3]] < 0)
92 ang = atan2(conv[nbr[2]] - conv[nbr[3]],
93 conv[nbr[1]] - conv[nbr[0]]);
96 dir = num_orients * ((ang +
M_PI) / (
M_PI * 2.0)) + 0.4999;
99 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.