@@ -267,35 +267,17 @@ def scale_score(self, status: str, metric : str = 'y') -> None:
267267 imgMax = FFmpegStream .get_frame (self .params .video_path , max_frame )
268268
269269 if success_min and success_max :
270- if self .is_vr_video ():
271- if 'sbs' in self .params .projection .split ('_' ):
272- imgMin = imgMin [:, :int (imgMin .shape [1 ]/ 2 )]
273- imgMax = imgMax [:, :int (imgMax .shape [1 ]/ 2 )]
274- elif 'ou' in self .params .projection .split ('_' ):
275- imgMin = imgMin [:int (imgMin .shape [0 ]/ 2 ), :]
276- imgMax = imgMax [:int (imgMax .shape [0 ]/ 2 ), :]
277- else :
278- self .logger .warning ("Unknown VR Projection Type: %s" , self .params .projection )
279-
280- if PROJECTION [self .params .projection ]['parameter' ]['width' ] > 0 :
281- scale = PROJECTION [self .params .projection ]['parameter' ]['width' ] / float (1.75 * imgMax .shape [1 ])
282- else :
283- scale = PROJECTION [self .params .projection ]['parameter' ]['height' ] / float (1.75 * imgMax .shape [0 ])
284-
285- imgMin = cv2 .resize (imgMin , None , fx = scale , fy = scale )
286- imgMax = cv2 .resize (imgMax , None , fx = scale , fy = scale )
270+ imgMin = FFmpegStream .get_projection (imgMin , self .projection_config )
271+ imgMax = FFmpegStream .get_projection (imgMax , self .projection_config )
287272
288273 min_tracking_points = self .get_tracking_points_by_frame_number (min_frame - self .params .start_frame )
289274 max_tracking_points = self .get_tracking_points_by_frame_number (max_frame - self .params .start_frame )
290275
291- # TODO: draw points to image
292- # NOTE: Code below does not work because image do not use the same projection
293-
294- # for points in min_tracking_points:
295- # imgMin = OpenCV_GUI.draw_point_to_image(imgMin, points)
276+ for points in min_tracking_points :
277+ imgMin = OpenCV_GUI .draw_point_to_image (imgMin , points )
296278
297- # for points in max_tracking_points:
298- # imgMax = OpenCV_GUI.draw_point_to_image(imgMax, points)
279+ for points in max_tracking_points :
280+ imgMax = OpenCV_GUI .draw_point_to_image (imgMax , points )
299281
300282 # print('min_tracking_points', min_tracking_points, 'max_tracking_points', max_tracking_points)
301283
@@ -512,11 +494,11 @@ def tracking(self) -> str:
512494 """
513495 first_frame = FFmpegStream .get_frame (self .params .video_path , self .params .start_frame )
514496
515- projection_config = self .ui .get_video_projection_config (first_frame , self .params .projection )
497+ self . projection_config = self .ui .get_video_projection_config (first_frame , self .params .projection )
516498
517499 video = FFmpegStream (
518500 video_path = self .params .video_path ,
519- config = projection_config ,
501+ config = self . projection_config ,
520502 skip_frames = self .params .skip_frames ,
521503 start_frame = self .params .start_frame
522504 )
0 commit comments