51 if (first == last)
return 0;
55 const struct env_dims prevdims = env_pyr_img(pyr, i-1)->dims;
56 const struct env_dims curdims = env_pyr_img(pyr, i)->dims;
62 if (curdims.
w != pw2)
return 0;
63 if (curdims.
h != ph2)
return 0;
78 const intg32*
const bptr = env_img_pixels(b);
79 const intg32*
const cptr = env_img_pixels(c);
86 dptr[i] = (bptr[i] < cptr[i]) ? cptr[i] - bptr[i] : bptr[i] - cptr[i];
87 if (dptr[i] < thresh) dptr[i] = 0;
92 static void abs_diff_thresh_pyr(
const struct env_pyr* b,
const struct env_pyr* c,
95 ENV_ASSERT(env_pyr_depth(b) == env_pyr_depth(c));
100 if (env_pyr_depth(
result) != n)
108 const struct env_image* bimg = env_pyr_img(b, i);
110 if (!env_img_initialized(bimg))
continue;
114 const struct env_image* cimg = env_pyr_img(c, i);
119 abs_diff_thresh(bimg, cimg, thresh, rimg);
132 if (env_pyr_depth(pyr) == 0)
163 (*envp->
submapPreProc)(tagName, clev, slev, &submap, env_pyr_img(pyr, clev), env_pyr_img(pyr, slev),
167 if (submap.
dims.
w > mapDims.
w || submap.
dims.
h > mapDims.
h)
174 else if (submap.
dims.
w < mapDims.
w || submap.
dims.
h < mapDims.
h)
190 (*envp->
submapPostNormProc)(tagName, clev, slev, &submap, env_pyr_img(pyr, clev), env_pyr_img(pyr, slev),
209 const struct env_dims inputdims,
const struct env_pyr* lowpass5,
const int normalizeOutput,
214 if (status_func) (*status_func)(status_userdata, tagName,
result);
226 const intg32 lumthresh = (3*255) / 10;
256 const intg32*
const byptr = env_img_pixels(&byOut);
260 for (
env_size_t i = 0; i < sz; ++i) dptr[i] = (dptr[i] / 2) + (byptr[i] / 2);
263 if (status_func) (*status_func)(status_userdata, tagName,
result);
296 env_chan_intensity(
"blue/yellow", envp, imath, by->
dims, &bypyr, 0, status_func, status_userdata, &byOut);
300 const intg32*
const byptr = env_img_pixels(&byOut);
304 for (
env_size_t i = 0; i < sz; ++i) dptr[i] = (dptr[i] + byptr[i]) >> 1;
307 if (status_func) (*status_func)(status_userdata, tagName,
result);
321 const intg32 sfnumer = 2069;
322 const intg32 sfdenom = 5000;
333 if (status_func) (*status_func)(status_userdata, tagName,
result);
355 's',
't',
'e',
'e',
'r',
'a',
'b',
'l',
'e',
357 '/',
'_',
'_',
')',
'\0'
372 buf[10] =
'0' + ((i+1) / 10);
373 buf[11] =
'0' + ((i+1) % 10);
375 env_chan_steerable(buf, envp, imath, img->
dims, &hipass9, thetaidx, status_func, status_userdata, &chanOut);
379 if (!env_img_initialized(
result))
400 if (status_func) (*status_func)(status_userdata, tagName,
result);
410 if (!env_img_initialized(prev))
422 abs_diff_thresh(cur, prev, lowthresh, &fli);
434 if (status_func) (*status_func)(status_userdata, tagName,
result);
449 if (env_pyr_depth(prev_lowpass5) == 0)
461 abs_diff_thresh_pyr(cur_lowpass5, prev_lowpass5, lowthresh, &fli);
465 if (status_func) (*status_func)(status_userdata, tagName,
result);
474 const struct env_pyr* unshiftedCur,
const struct env_pyr* shiftedPrev,
483 if (env_pyr_depth(unshiftedPrev) == 0)
501 const intg32*
const ucurr = env_img_pixels(env_pyr_img(unshiftedCur, i));
502 const intg32*
const uprev = env_img_pixels(env_pyr_img(unshiftedPrev, i));
503 const intg32*
const scurr = env_img_pixels(env_pyr_img(shiftedCur, i));
504 const intg32*
const sprev = env_img_pixels(env_pyr_img(shiftedPrev, i));
505 intg32*
const dptr = env_img_pixelsw(env_pyr_imgw(&pyr, i));
507 const env_size_t sz = env_img_size(env_pyr_img(&pyr, i));
511 dptr[c] = ((ucurr[c] >> nshift) * (sprev[c] >> nshift)) - ((uprev[c] >> nshift) * (scurr[c] >> nshift));
513 if (dptr[c] < lowthresh) dptr[c] = 0;
519 if (status_func) (*status_func)(status_userdata, tagName,
result);