Click here to Skip to main content
15,358,470 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Canvas is not displaying video even there is no error while execution of code

What I have tried:

Python
def ir_frame_to_jpg(self, IRFrame): 
         IRFrame = IRFrame.reshape((const.ir_image_size))
         IRFrame = np.uint8(IRFrame)

         jpgIRFrame = np.zeros((const.ir_image_size[0],const.ir_image_size[1],3), np.uint8)
         jpgIRFrame[:,:,0]  =  IRFrame
         jpgIRFrame[:,:,1]  =  IRFrame
         jpgIRFrame[:,:,2]  =  IRFrame
         return jpgIRFrame
   def button1_clicked(self):
       kinect = PyKinectRuntime.PyKinectRuntime(PyKinectV2.FrameSourceTypes_Color |
                                              PyKinectV2.FrameSourceTypes_Infrared |
                                              PyKinectV2.FrameSourceTypes_Depth)
       redAlert = np.zeros((const.ir_image_size[0],const.ir_image_size[1],3),np.uint8)
       redAlert[:,:,2] = 255
       run = True
       
       c = Canvas(self.root, width = 512, height = 424)
       c.place(x=0, y=0)
       #ph = ImageTk.PhotoImage(Image.open(self.ir_frame_to_jpg(kinect.get_last_depth_frame())))
       ph = ImageTk.PhotoImage(image=Image.fromarray(self.ir_frame_to_jpg(kinect.get_last_depth_frame())))
       #ph = ImageTk.PhotoImage(self.ir_frame_to_jpg(kinect.get_last_depth_frame()))
       c.create_image(0, 0, image = ph, anchor = NW)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900