Major fixes to work on 1280x800
This commit is contained in:
parent
b5e63b9fd0
commit
217bf14ea3
1 changed files with 11 additions and 6 deletions
17
head_pose.py
17
head_pose.py
|
@ -231,13 +231,13 @@ if not args.hide_graph:
|
||||||
canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
|
canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
|
||||||
|
|
||||||
imageWindowRoot = Tk.Toplevel()
|
imageWindowRoot = Tk.Toplevel()
|
||||||
imageWindowSize = (1280,800)
|
imageWindowSize = tuple(metricsSize)
|
||||||
imageWindowRoot.geometry('%dx%d+%d+%d' % (imageWindowSize[0],imageWindowSize[1],0,0))
|
imageWindowRoot.geometry('%dx%d+%d+%d' % (imageWindowSize[0],imageWindowSize[1],0,0))
|
||||||
imageWindowRoot.attributes("-fullscreen", True)
|
imageWindowRoot.attributes("-fullscreen", True)
|
||||||
# imageCanvas is where the heatmap image is drawn
|
# imageCanvas is where the heatmap image is drawn
|
||||||
imageCanvas = Tk.Canvas(imageWindowRoot,width=1280,height=800)
|
imageCanvas = Tk.Canvas(imageWindowRoot,width=1280,height=800)
|
||||||
imageCanvas.pack()
|
imageCanvas.pack()
|
||||||
imageWindowRoot.lift()
|
|
||||||
|
|
||||||
if args.output_dir:
|
if args.output_dir:
|
||||||
startTime = time.time()
|
startTime = time.time()
|
||||||
|
@ -247,6 +247,10 @@ if args.queue_length:
|
||||||
imageQueue = []
|
imageQueue = []
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
if args.hide_preview:
|
||||||
|
# if preview is hidden, we can always re-raise the image window
|
||||||
|
imageWindowRoot.lift()
|
||||||
|
|
||||||
t1 = time.time()
|
t1 = time.time()
|
||||||
_, im = c.read()
|
_, im = c.read()
|
||||||
size = im.shape
|
size = im.shape
|
||||||
|
@ -373,9 +377,9 @@ while True:
|
||||||
x = translation_vector[0] + rotation_vector[0] * a
|
x = translation_vector[0] + rotation_vector[0] * a
|
||||||
y = translation_vector[1] + rotation_vector[1] * a
|
y = translation_vector[1] + rotation_vector[1] * a
|
||||||
|
|
||||||
a = - translation_vector[2] / viewDirectionVector[2]
|
# a = - translation_vector[2] / viewDirectionVector[2]
|
||||||
x = translation_vector[0] + viewDirectionVector[0] * a
|
# x = translation_vector[0] + viewDirectionVector[0] * a
|
||||||
y = translation_vector[1] + viewDirectionVector[1] * a
|
# y = translation_vector[1] + viewDirectionVector[1] * a
|
||||||
point = np.array([x,y])
|
point = np.array([x,y])
|
||||||
|
|
||||||
currentPoint = point
|
currentPoint = point
|
||||||
|
@ -474,7 +478,7 @@ while True:
|
||||||
|
|
||||||
tkpi = ImageTk.PhotoImage(image)
|
tkpi = ImageTk.PhotoImage(image)
|
||||||
imageCanvas.delete("IMG")
|
imageCanvas.delete("IMG")
|
||||||
imagesprite = imageCanvas.create_image(500,500,image=tkpi, tags="IMG")
|
imagesprite = imageCanvas.create_image(metricsSize[0]/2, metricsSize[1]/2,image=tkpi, tags="IMG")
|
||||||
imageWindowRoot.update()
|
imageWindowRoot.update()
|
||||||
tm24 = time.time()
|
tm24 = time.time()
|
||||||
logger.debug("PIL image generated in %fs", tm24 - tm23)
|
logger.debug("PIL image generated in %fs", tm24 - tm23)
|
||||||
|
@ -490,6 +494,7 @@ while True:
|
||||||
te5 = time.time()
|
te5 = time.time()
|
||||||
logger.debug("Drew graph & updated window in %fs", te5-te4)
|
logger.debug("Drew graph & updated window in %fs", te5-te4)
|
||||||
|
|
||||||
|
logger.warn("{}".format(image.size))
|
||||||
if args.output_dir:
|
if args.output_dir:
|
||||||
# save output to dir
|
# save output to dir
|
||||||
now = tm24 # time.time()
|
now = tm24 # time.time()
|
||||||
|
|
Loading…
Reference in a new issue