JeVoisBase
1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
|
|
#include <jevoisbase/Components/Saliency/env_config.h>
#include <jevoisbase/Components/Saliency/env_image.h>
#include <jevoisbase/Components/Saliency/env_math.h>
#include <jevoisbase/Components/Saliency/env_pyr.h>
Go to the source code of this file.
Macros | |
#define | INTMAXNORMMIN ((intg32) 0) |
#define | INTMAXNORMMAX ((intg32) 32768) |
Functions | |
void | env_dec_xy (const struct env_image *src, struct env_image *result) |
Decimate in X and Y (take one every 'factor' pixels). | |
void | env_dec_x (const struct env_image *src, struct env_image *result) |
Decimate in X (take one every 'factor' pixels). | |
void | env_dec_y (const struct env_image *src, struct env_image *result) |
Decimate in Y (take one every 'factor' pixels). | |
void | env_lowpass_5_x_dec_x (const struct env_image *src, const struct env_math *imath, struct env_image *result) |
void | env_lowpass_5_y_dec_y (const struct env_image *src, const struct env_math *imath, struct env_image *result) |
void | env_lowpass_9_x (const struct env_image *src, const struct env_math *imath, struct env_image *result) |
void | env_lowpass_9_y (const struct env_image *src, const struct env_math *imath, struct env_image *result) |
void | env_lowpass_9 (const struct env_image *src, const struct env_math *imath, struct env_image *result) |
void | env_quad_energy (const struct env_image *img1, const struct env_image *img2, struct env_image *result) |
void | env_steerable_filter (const struct env_image *src, const intg32 kxnumer, const intg32 kynumer, const env_size_t kdenombits, const struct env_math *imath, struct env_image *result) |
void | env_attenuate_borders_inplace (struct env_image *a, env_size_t size) |
void | env_pyr_build_hipass_9 (const struct env_image *image, env_size_t firstlevel, const struct env_math *imath, struct env_pyr *result) |
void | env_pyr_build_steerable_from_hipass_9 (const struct env_pyr *hipass, const intg32 kxnumer, const intg32 kynumer, const env_size_t kdenombits, const struct env_math *imath, struct env_pyr *result) |
void | env_pyr_build_lowpass_5 (const struct env_image *image, env_size_t firstlevel, const struct env_math *imath, struct env_pyr *result) |
Wrapper for _cpu or _cuda version. | |
void | env_pyr_build_lowpass_5_cpu (const struct env_image *image, env_size_t firstlevel, const struct env_math *imath, struct env_pyr *result) |
_cpu version implemented here, see CUDA/env_cuda.h for GPU version | |
void | env_downsize_9_inplace (struct env_image *src, const env_size_t depth, const struct env_math *imath) |
void | env_rescale (const struct env_image *src, struct env_image *result) |
void | env_max_normalize_inplace (struct env_image *src, intg32 min, intg32 max, enum env_maxnorm_type typ, const intg32 rangeThresh) |
void | env_max_normalize_none_inplace (struct env_image *src, intg32 min, intg32 max, const intg32 rangeThresh) |
void | env_max_normalize_std_inplace (struct env_image *src, intg32 min, intg32 max, const intg32 rangeThresh) |
void | env_center_surround (const struct env_image *center, const struct env_image *surround, const int absol, struct env_image *result) |
void | env_get_rgby (const struct env_rgb_pixel *const src, const env_size_t sz, struct env_image *rg, struct env_image *by, const intg32 thresh, const env_size_t inputbits) |
Compute R-G and B-Y opponent color maps. | |
void | env_merge_range (const struct env_image *src, intg32 *mi, intg32 *ma) |
Update the range [mi,ma] to include the range of values in src. | |
void | env_rescale_range_inplace (struct env_image *src, const intg32 mi, const intg32 ma) |
rescale the src image to a [0..255] result | |
void | env_grid_average (const struct env_image *src, unsigned char *dest, unsigned int bitshift, env_size_t nx, env_size_t ny) |
Compute average values in each tile of a grid. | |
void | env_shift_clean (const struct env_image *srcImg, const env_ssize_t dx, const env_ssize_t dy, struct env_image *result) |
Shift an image by (dx, dy), without wraparound. | |
void | env_shift_image (const struct env_image *srcImg, const env_ssize_t dxnumer, const env_ssize_t dynumer, const env_size_t denombits, struct env_image *result) |
Fixed-point integer math versions of some of our floating-point image functions
Definition in file env_image_ops.h.
#define INTMAXNORMMAX ((intg32) 32768) |
Definition at line 48 of file env_image_ops.h.
#define INTMAXNORMMIN ((intg32) 0) |
Definition at line 47 of file env_image_ops.h.
void env_attenuate_borders_inplace | ( | struct env_image * | a, |
env_size_t | size | ||
) |
Definition at line 404 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, env_dims::h, and env_dims::w.
Referenced by env_center_surround(), and env_pyr_build_steerable_from_hipass_9().
void env_center_surround | ( | const struct env_image * | center, |
const struct env_image * | surround, | ||
const int | absol, | ||
struct env_image * | result | ||
) |
Definition at line 763 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, ENV_ASSERT2, env_attenuate_borders_inplace(), ENV_MAX, env_dims::h, and env_dims::w.
Referenced by env_chan_process_pyr().
Decimate in X (take one every 'factor' pixels).
Definition at line 86 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, env_img_copy_src_dst(), env_img_resize_dims(), env_dims::h, and env_dims::w.
Referenced by env_dec_xy(), and env_downsize_9_inplace().
Decimate in X and Y (take one every 'factor' pixels).
Definition at line 45 of file env_image_ops.c.
References env_image::dims, env_dec_x(), env_dec_y(), env_img_copy_src_dst(), env_img_resize_dims(), env_dims::h, and env_dims::w.
Referenced by env_pyr_build_hipass_9().
Decimate in Y (take one every 'factor' pixels).
Definition at line 115 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, env_img_copy_src_dst(), env_img_resize_dims(), env_dims::h, and env_dims::w.
Referenced by env_dec_xy(), and env_downsize_9_inplace().
void env_downsize_9_inplace | ( | struct env_image * | src, |
const env_size_t | depth, | ||
const struct env_math * | imath | ||
) |
Definition at line 561 of file env_image_ops.c.
References env_image::dims, env_dec_x(), env_dec_y(), env_img_init(), env_img_make_empty(), env_img_swap(), env_lowpass_9_x(), env_lowpass_9_y(), and env_dims::h.
Referenced by env_chan_process_pyr().
void env_get_rgby | ( | const struct env_rgb_pixel *const | src, |
const env_size_t | sz, | ||
struct env_image * | rg, | ||
struct env_image * | by, | ||
const intg32 | thresh, | ||
const env_size_t | inputbits | ||
) |
Compute R-G and B-Y opponent color maps.
Definition at line 819 of file env_image_ops.c.
References ENV_ABS, and ENV_ASSERT.
Referenced by env_chan_color().
void env_grid_average | ( | const struct env_image * | src, |
unsigned char * | dest, | ||
unsigned int | bitshift, | ||
env_size_t | nx, | ||
env_size_t | ny | ||
) |
Compute average values in each tile of a grid.
dest should have enough memory allocated to contain one byte per grid tile. bitshift is a rightward bit shift that will be applied to the average intg32 value to convert it to byte. If image width or height is not an exact multiple of nx or ny, tile size will be rounded down and some pixels may be skipped between tiles, but tile locations will remain as accurate as possible. Note that here we assume positive values and clamp if negative, this is because the default saliency channels take the absolute value when computing center-surround.
Definition at line 931 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, env_dims::h, and env_dims::w.
void env_lowpass_5_x_dec_x | ( | const struct env_image * | src, |
const struct env_math * | imath, | ||
struct env_image * | result | ||
) |
Definition at line 143 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, env_c_lowpass_5_x_dec_x_fewbits_optim(), env_img_copy_src_dst(), env_img_resize_dims(), env_dims::h, env_math::nbits, and env_dims::w.
Referenced by env_pyr_build_lowpass_5().
void env_lowpass_5_y_dec_y | ( | const struct env_image * | src, |
const struct env_math * | imath, | ||
struct env_image * | result | ||
) |
Definition at line 171 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, env_c_lowpass_5_y_dec_y_fewbits_optim(), env_img_copy_src_dst(), env_img_resize_dims(), env_dims::h, env_math::nbits, and env_dims::w.
Referenced by env_pyr_build_lowpass_5().
void env_lowpass_9 | ( | const struct env_image * | src, |
const struct env_math * | imath, | ||
struct env_image * | result | ||
) |
Definition at line 307 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, env_img_init(), env_img_make_empty(), env_img_swap(), env_lowpass_9_x(), env_lowpass_9_y(), and env_dims::h.
Referenced by env_pyr_build_hipass_9(), and env_steerable_filter().
void env_lowpass_9_x | ( | const struct env_image * | src, |
const struct env_math * | imath, | ||
struct env_image * | result | ||
) |
Definition at line 198 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, env_c_lowpass_9_x_fewbits_optim(), env_img_copy_src_dst(), env_dims::h, env_math::nbits, and env_dims::w.
Referenced by env_downsize_9_inplace(), and env_lowpass_9().
void env_lowpass_9_y | ( | const struct env_image * | src, |
const struct env_math * | imath, | ||
struct env_image * | result | ||
) |
Definition at line 253 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, env_c_lowpass_9_y_fewbits_optim(), env_dims::h, env_math::nbits, and env_dims::w.
Referenced by env_downsize_9_inplace(), and env_lowpass_9().
void env_max_normalize_inplace | ( | struct env_image * | src, |
intg32 | min, | ||
intg32 | max, | ||
enum env_maxnorm_type | typ, | ||
const intg32 | rangeThresh | ||
) |
Definition at line 659 of file env_image_ops.c.
References ENV_ASSERT2, env_max_normalize_none_inplace(), env_max_normalize_std_inplace(), ENV_VCXNORM_MAXNORM, and ENV_VCXNORM_NONE.
Referenced by env_chan_color(), env_chan_color_rgby(), env_chan_orientation(), env_chan_process_pyr(), env_motion_channel_input_and_consume_pyr(), and Saliency::process().
void env_max_normalize_none_inplace | ( | struct env_image * | src, |
intg32 | min, | ||
intg32 | max, | ||
const intg32 | rangeThresh | ||
) |
Definition at line 672 of file env_image_ops.c.
References env_c_inplace_normalize(), and env_c_inplace_rectify().
Referenced by env_max_normalize_inplace().
void env_max_normalize_std_inplace | ( | struct env_image * | src, |
intg32 | min, | ||
intg32 | max, | ||
const intg32 | rangeThresh | ||
) |
Definition at line 685 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, ENV_ASSERT2, env_c_inplace_normalize(), env_c_inplace_rectify(), h, env_dims::h, INTG32_MAX, and env_dims::w.
Referenced by env_max_normalize_inplace().
Update the range [mi,ma] to include the range of values in src.
Definition at line 883 of file env_image_ops.c.
void env_pyr_build_hipass_9 | ( | const struct env_image * | image, |
env_size_t | firstlevel, | ||
const struct env_math * | imath, | ||
struct env_pyr * | result | ||
) |
Definition at line 458 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, env_c_image_minus_image(), env_dec_xy(), env_img_initializer, env_img_make_empty(), env_img_resize_dims(), and env_lowpass_9().
Referenced by env_chan_orientation().
void env_pyr_build_lowpass_5 | ( | const struct env_image * | image, |
env_size_t | firstlevel, | ||
const struct env_math * | imath, | ||
struct env_pyr * | result | ||
) |
Wrapper for _cpu or _cuda version.
Definition at line 534 of file env_image_ops.c.
References env_pyr::depth, ENV_ASSERT, env_img_copy_src_dst(), env_img_initializer, env_img_make_empty(), env_lowpass_5_x_dec_x(), and env_lowpass_5_y_dec_y().
Referenced by env_chan_color(), env_chan_color_rgby(), env_chan_flicker(), Saliency::process(), and Saliency::process().
void env_pyr_build_lowpass_5_cpu | ( | const struct env_image * | image, |
env_size_t | firstlevel, | ||
const struct env_math * | imath, | ||
struct env_pyr * | result | ||
) |
_cpu version implemented here, see CUDA/env_cuda.h for GPU version
void env_pyr_build_steerable_from_hipass_9 | ( | const struct env_pyr * | hipass, |
const intg32 | kxnumer, | ||
const intg32 | kynumer, | ||
const env_size_t | kdenombits, | ||
const struct env_math * | imath, | ||
struct env_pyr * | result | ||
) |
Definition at line 505 of file env_image_ops.c.
References env_pyr::depth, env_attenuate_borders_inplace(), env_img_resize_dims(), env_pyr_init(), env_pyr_make_empty(), env_pyr_swap(), and env_steerable_filter().
Referenced by env_chan_steerable().
void env_quad_energy | ( | const struct env_image * | img1, |
const struct env_image * | img2, | ||
struct env_image * | result | ||
) |
Definition at line 320 of file env_image_ops.c.
References ENV_ABS, and ENV_ASSERT.
Referenced by env_steerable_filter().
Definition at line 585 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, env_img_copy_src_dst(), ENV_MAX, ENV_MIN, env_dims::h, and env_dims::w.
Referenced by env_chan_process_pyr().
rescale the src image to a [0..255] result
Definition at line 903 of file env_image_ops.c.
References ENV_ASSERT, and INTG32_MAX.
void env_shift_clean | ( | const struct env_image * | srcImg, |
const env_ssize_t | dx, | ||
const env_ssize_t | dy, | ||
struct env_image * | result | ||
) |
Shift an image by (dx, dy), without wraparound.
Definition at line 969 of file env_image_ops.c.
References env_image::dims, ENV_ABS, ENV_ASSERT, env_img_make_empty(), ENV_MAX, ENV_MIN, h, env_dims::h, and env_dims::w.
Referenced by env_shift_image().
void env_shift_image | ( | const struct env_image * | srcImg, |
const env_ssize_t | dxnumer, | ||
const env_ssize_t | dynumer, | ||
const env_size_t | denombits, | ||
struct env_image * | result | ||
) |
Definition at line 1017 of file env_image_ops.c.
References env_image::dims, ENV_ASSERT, env_img_make_empty(), ENV_MAX, ENV_MIN, env_shift_clean(), h, env_dims::h, and env_dims::w.
Referenced by env_motion_channel_input_and_consume_pyr().
void env_steerable_filter | ( | const struct env_image * | src, |
const intg32 | kxnumer, | ||
const intg32 | kynumer, | ||
const env_size_t | kdenombits, | ||
const struct env_math * | imath, | ||
struct env_image * | result | ||
) |
Definition at line 347 of file env_image_ops.c.
References env_math::costab, env_image::dims, ENV_ABS, ENV_ASSERT, env_img_init(), env_img_make_empty(), env_img_swap(), env_lowpass_9(), env_quad_energy(), ENV_TRIG_NBITS, ENV_TRIG_TABSIZ, env_dims::h, INTG32_MAX, env_math::sintab, and env_dims::w.
Referenced by env_pyr_build_steerable_from_hipass_9().