File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 153153 tmp_size = 0 ;
154154 k = 1 ;
155155 for i = 1 : length(segmentation_configs .TRAJECTORIES .items )
156- if segmentation_configs .PARTITION(i ) <= 1
156+ if segmentation_configs .PARTITION(i ) < 1
157+ continue ;
158+ elseif segmentation_configs .PARTITION(i ) == 1 % trajectory turned to segment
159+ d_points{k ,1 } = segmentation_configs .SEGMENTS .items(2 ).points;
160+ d_lengths(k ,1 ) = segmentation_configs .FEATURES_VALUES_SEGMENTS(i ,10 );
161+ d_offsets(k ,1 ) = segmentation_configs .SEGMENTS .items(2 ).offset;
162+ d_rem_points = [d_rem_points ;{[0 ,0 ,0 ]}];
163+ d_rem_distances = [d_rem_distances ;{[0 ,0 ,0 ]}];
164+ k = k + 1 ;
157165 continue ;
158166 end
159167 trajectory_points = segmentation_configs .TRAJECTORIES .items(i ).points;
197205 endIndex = length(find(d_lengths(i ,: ) ~= - 1 ));
198206 % If we have only 1 interval continue
199207 if endIndex == 1
208+ class_map_detailed(i ,1 ) = class_map(i ,1 ); % trajectory turn to segment
200209 continue ;
201210 end
202211 endIndex_traj = length(find(class_map(i ,: ) ~= - 1 ));
Original file line number Diff line number Diff line change 55 rem_time = - 1 * ones(size(store_d ,1 ),1 );
66
77 for i = 1 : size(d_points ,1 )
8+ if isempty(d_points{i ,2 }) % unsegmented trajectory was converted to segment
9+ tmp = d_points{i ,1 }(: ,1 );
10+ time_per_segment(i ,1 ) = tmp(end ) - tmp(1 );
11+ rem_time(i ) = 0 ;
12+ continue ;
13+ end
814 cum_time = 0 ;
915 for j = 1 : size(d_points ,2 )
1016 if isempty(d_points{i ,j })
1824 tmp = store_d{i }(: ,1 );
1925 end
2026 a = find(tmp ~= - 1 );
27+ if isempty(a )
28+ continue
29+ end
2130 a = tmp(a(1 ));
2231 b = find(sel_seg ~= - 1 );
32+ if isempty(b )
33+ continue
34+ end
2335 b = sel_seg(b(end ));
2436 end_time = b + (a - b )/2 ;
2537 end
2638 start_time = sel_seg(1 );
2739 if sel_seg(1 ) == - 1 % find start time (the first one cannot have -1)
2840 tmp = d_points{i ,j - 1 }(: ,1 );
2941 a = find(tmp ~= - 1 );
42+ if isempty(a )
43+ continue
44+ end
3045 a = tmp(a(end ));
3146 b = find(sel_seg ~= - 1 );
47+ if isempty(b )
48+ continue
49+ end
3250 b = sel_seg(b(1 ));
3351 start_time = b + (b - a )/2 ;
3452 end
You can’t perform that action at this time.
0 commit comments