diff --git a/EyeTrackingProcess/0.video2pic.py b/EyeTrackingProcess/0.video2pic.py index 5a196e3..da2e4b3 100644 --- a/EyeTrackingProcess/0.video2pic.py +++ b/EyeTrackingProcess/0.video2pic.py @@ -29,7 +29,7 @@ success = True while success: success,image = vidcap.read() - filename = str("\\%d.jpg" % (count+1)) + filename = str("/%d.jpg" % (count+1)) filepath = path + filename cv2.imwrite(filepath, image) # save frame as JPEG file count += 1 diff --git a/EyeTrackingProcess/2.PlotEyeTrackingOnImgs.py b/EyeTrackingProcess/2.PlotEyeTrackingOnImgs.py index 7bf6417..c091b19 100644 --- a/EyeTrackingProcess/2.PlotEyeTrackingOnImgs.py +++ b/EyeTrackingProcess/2.PlotEyeTrackingOnImgs.py @@ -61,7 +61,7 @@ def return_x_y(gaze): for j in tqdm(framelist): i = int(re.findall("\d+",j)[0]) - img_path = os.getcwd() + '\\2.videos_frames\\' + frame_dir + '\\' + j + img_path = os.getcwd() + '/2.videos_frames/' + frame_dir + '/' + j # time from the video t = i/30 # time in raw data @@ -85,7 +85,7 @@ def return_x_y(gaze): cv2.circle(img,(cv_x_l, cv_y_l), 20, (0,255,0),-1) cv2.circle(img,(cv_x_r,cv_y_r), 20, (255,0,0),-1) #plt.imshow(img) - cv2.imwrite(frame_out_dir + '\\' + re.findall("\d+",j)[0] +'.jpg',img) + cv2.imwrite(frame_out_dir + '/' + re.findall("\d+",j)[0] +'.jpg',img) else: # Find the closest time in valid raw data @@ -108,11 +108,11 @@ def return_x_y(gaze): cv2.circle(img,(cv_x_l, cv_y_l), 20, (0,255,0),-1) cv2.circle(img,(cv_x_r,cv_y_r), 20, (255,0,0),-1) #plt.imshow(img) - cv2.imwrite(frame_out_dir + '\\' + re.findall("\d+",j)[0] +'.jpg',img) + cv2.imwrite(frame_out_dir + '/' + re.findall("\d+",j)[0] +'.jpg',img) else: img =cv2.imread(img_path) - cv2.imwrite(frame_out_dir + '\\' + re.findall("\d+",j)[0] +'.jpg',img) + cv2.imwrite(frame_out_dir + '/' + re.findall("\d+",j)[0] +'.jpg',img)