JeVoisBase  1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
Loading...
Searching...
No Matches
env_params.c
Go to the documentation of this file.
1/*!@file env_params.c */
2
3// //////////////////////////////////////////////////////////////////// //
4// The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2000-2005 //
5// by the University of Southern California (USC) and the iLab at USC. //
6// See http://iLab.usc.edu for information about this project. //
7// //////////////////////////////////////////////////////////////////// //
8// Major portions of the iLab Neuromorphic Vision Toolkit are protected //
9// under the U.S. patent ``Computation of Intrinsic Perceptual Saliency //
10// in Visual Environments, and Applications'' by Christof Koch and //
11// Laurent Itti, California Institute of Technology, 2001 (patent //
12// pending; application number 09/912,225 filed July 23, 2001; see //
13// http://pair.uspto.gov/cgi-bin/final/home.pl for current status). //
14// //////////////////////////////////////////////////////////////////// //
15// This file is part of the iLab Neuromorphic Vision C++ Toolkit. //
16// //
17// The iLab Neuromorphic Vision C++ Toolkit is free software; you can //
18// redistribute it and/or modify it under the terms of the GNU General //
19// Public License as published by the Free Software Foundation; either //
20// version 2 of the License, or (at your option) any later version. //
21// //
22// The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope //
23// that it will be useful, but WITHOUT ANY WARRANTY; without even the //
24// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
25// PURPOSE. See the GNU General Public License for more details. //
26// //
27// You should have received a copy of the GNU General Public License //
28// along with the iLab Neuromorphic Vision C++ Toolkit; if not, write //
29// to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, //
30// Boston, MA 02111-1307 USA. //
31// //////////////////////////////////////////////////////////////////// //
32//
33// Primary maintainer for this file: Rob Peters <rjpeters at usc dot edu>
34// $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Envision/env_params.c $
35// $Id: env_params.c 9830 2008-06-18 18:50:22Z lior $
36//
37
39
41
42// ######################################################################
44{
46 envp->range_thresh = 0;
47 envp->scale_bits = 16; /// WAS 30;
48 envp->num_motion_directions = 4;
49 envp->motion_thresh = 0;
50 envp->flicker_thresh = 0;
51 envp->multiscale_flicker = 0;
52 envp->num_orientations = 4;
53 envp->cs_lev_min = 2;
54 envp->cs_lev_max = 4;
55 envp->cs_del_min = 3;
56 envp->cs_del_max = 4;
57 envp->output_map_level = 4;
58 envp->chan_i_weight = 255;
59 envp->chan_c_weight = 255;
60 envp->chan_o_weight = 255;
61 envp->chan_f_weight = 255;
62 envp->chan_m_weight = 255;
63
64 envp->submapPreProc = 0;
65 envp->submapPostNormProc = 0;
66 envp->submapPostProc = 0;
67 envp->user_data_preproc = 0;
68 envp->user_data_postnorm = 0;
69 envp->user_data_postproc = 0;
70}
71
72// ######################################################################
74{
75 return (envp->cs_del_max - envp->cs_del_min + 1) * (envp->cs_lev_max - envp->cs_lev_min + 1);
76}
77
78// ######################################################################
80{
81 return (envp->cs_lev_max + envp->cs_del_max + 1);
82}
83
84// ######################################################################
86{
87 return
88 ((intg32) envp->chan_c_weight)
89 + ((intg32) envp->chan_i_weight)
90 + ((intg32) envp->chan_o_weight)
91 + ((intg32) envp->chan_f_weight)
92 + ((intg32) envp->chan_m_weight)
93 ;
94}
95
96// ######################################################################
97void env_params_validate(const struct env_params* envp)
98{
100 ENV_ASSERT((envp->scale_bits+1) < (8*sizeof(intg32)));
102 ENV_ASSERT(envp->num_orientations <= 99);
103
104 ENV_ASSERT(envp->cs_lev_max >= envp->cs_lev_min);
105 ENV_ASSERT(envp->cs_del_max >= envp->cs_del_min);
106
107 ENV_ASSERT(env_total_weight(envp) > 0);
108}
#define ENV_ASSERT(expr)
Definition env_log.h:63
intg32 env_total_weight(const struct env_params *envp)
Definition env_params.c:85
void env_params_set_defaults(struct env_params *envp)
Definition env_params.c:43
void env_params_validate(const struct env_params *envp)
Definition env_params.c:97
env_size_t env_max_cs_index(const struct env_params *envp)
Definition env_params.c:73
env_size_t env_max_pyr_depth(const struct env_params *envp)
Definition env_params.c:79
ENV_INTG32_TYPE intg32
32-bit signed integer
Definition env_types.h:52
@ ENV_VCXNORM_MAXNORM
non-iterative maxnorm
Definition env_types.h:90
@ ENV_VCXNORM_NONE
no max-normalization, but may change range
Definition env_types.h:89
unsigned long env_size_t
Definition env_types.h:71
byte chan_f_weight
Definition env_params.h:62
void * user_data_postnorm
Definition env_params.h:81
byte multiscale_flicker
Definition env_params.h:52
byte chan_o_weight
Definition env_params.h:61
env_size_t cs_del_max
Definition env_params.h:57
byte chan_c_weight
Definition env_params.h:60
void * user_data_preproc
Definition env_params.h:80
int(* submapPostProc)(const char *tagName, struct env_image *cmap, void *user_data)
Definition env_params.h:77
int(* submapPreProc)(const char *tagName, env_size_t clev, env_size_t slev, struct env_image *submap, const struct env_image *center, const struct env_image *surround, void *user_data)
Definition env_params.h:65
env_size_t cs_del_min
Definition env_params.h:56
intg32 range_thresh
Definition env_params.h:47
env_size_t output_map_level
the pyramid level at which the feature map is taken
Definition env_params.h:58
void * user_data_postproc
Definition env_params.h:82
byte chan_m_weight
Definition env_params.h:63
env_size_t scale_bits
Definition env_params.h:48
env_size_t num_motion_directions
Definition env_params.h:49
int(* submapPostNormProc)(const char *tagName, env_size_t clev, env_size_t slev, struct env_image *submap, const struct env_image *center, const struct env_image *surround, void *user_data)
Definition env_params.h:71
enum env_maxnorm_type maxnorm_type
Definition env_params.h:46
env_size_t cs_lev_min
Definition env_params.h:54
env_size_t cs_lev_max
Definition env_params.h:55
byte chan_i_weight
Definition env_params.h:59
byte flicker_thresh
Definition env_params.h:51
byte motion_thresh
Definition env_params.h:50
env_size_t num_orientations
number of Gabor subchannels
Definition env_params.h:53