Home > data-import > make_vision_variables.m

make_vision_variables

PURPOSE ^

agents is optional and should be cell of strings. Default is {'child' 'parent'};

SYNOPSIS ^

function make_vision_variables(IDs, obj_list, agents)

DESCRIPTION ^

agents is optional and should be cell of strings. Default is {'child' 'parent'};

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function make_vision_variables(IDs, obj_list, agents)
0002 %agents is optional and should be cell of strings. Default is {'child' 'parent'};
0003 
0004 if numel(num2str(IDs(1))) > 2
0005     subs = IDs;
0006 else
0007     subs = list_subjects(IDs);
0008 end
0009 
0010 if ~exist('agents', 'var') || isempty(agents)
0011     agents = {'child', 'parent'};
0012 end
0013 
0014 obj_num = max(obj_list);
0015 
0016 seg_image_overwrite_flag = true;
0017 is_record_vision_vars = true;
0018 is_record_eye_vars = false;
0019 seg_image_format = 'png';
0020 for s = 1:numel(subs)
0021     sub_id = subs(s);
0022     for a = 1:numel(agents)
0023         agent_type = agents{a};
0024         if strcmp(agent_type, 'child')
0025             if ismember(sub2exp(sub_id), [14 16 17 18 23 28])
0026                 target_cam = 'cam01';
0027             else
0028                 target_cam = 'cam07';
0029             end
0030             dest_cam = 'cam01';
0031             
0032         elseif strcmp(agent_type, 'parent')
0033             if ismember(sub2exp(sub_id), [14 16 17 18 23 28])
0034                 target_cam = 'cam02';
0035             else
0036                 target_cam = 'cam08';
0037             end
0038             dest_cam = 'cam02';
0039         elseif strcmp(agent_type, 'topdown')
0040             target_cam = 'cam09';
0041             dest_cam = 'cam09';
0042         end
0043         
0044         obj_params = get_object_hsv_parameters(sub2exp(sub_id), sub_id);
0045         
0046         eye_var_name = ['cont2_eye_xy_' agent_type];
0047         if ~has_variable(sub_id, eye_var_name)
0048             fprintf('Subject %d does not have variable cont2_eye_xy_%s\n', sub_id, agent_type)
0049             is_record_eye_vars = false;
0050         end
0051         if obj_num == 5
0052             main_create_vision_vars_5(sub_id, target_cam, dest_cam, agent_type, obj_num, obj_params, is_record_vision_vars, is_record_eye_vars, seg_image_overwrite_flag, seg_image_format)
0053 %             main_create_vision_eye_vars_5(sub_id, target_cam, dest_cam, agent_type, obj_num, obj_params, is_record_vision_vars, is_record_eye_vars, seg_image_overwrite_flag, seg_image_format);
0054         elseif obj_num == 3
0055             main_create_vision_eye_vars_3(sub_id, target_cam, dest_cam, agent_type, obj_num, obj_params, is_record_vision_vars, is_record_eye_vars, seg_image_overwrite_flag, seg_image_format);
0056         end
0057     end
0058 end
0059 end

Generated on Tue 23-May-2017 20:00:55 by m2html © 2005