Skip to content

Commit

Permalink
slash
Browse files Browse the repository at this point in the history
  • Loading branch information
XiangGuo1992 committed Mar 16, 2020
1 parent e704b57 commit 5d956fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion EyeTrackingProcess/0.video2pic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions EyeTrackingProcess/2.PlotEyeTrackingOnImgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)



Expand Down

0 comments on commit 5d956fb

Please sign in to comment.