Python Forum
Creating a GUI for Point Cloud visualisation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating a GUI for Point Cloud visualisation
#1
Hello everyone, i need to create a interface for the visualisation the Point Cloud (PCD-Format), i tried with this code but it`s doesnt work.
Normally i want to build a simple visualisation tool to visualise Point cloud Data with some Buttons for example ( Swiping the Pictures or using some Filter or adding some options too..)
In my code i tried to build Point Cloud viewer
i will be very thankful for the help

this the Code:


from tkinter import*
from PIL import ImageTk,Image
import numpy as np
import open3d as o3d

root= Tk()
root.title(" Visualisierung ")
img = PhotoImage(file='index.ico')
root.tk.call('wm', 'iconphoto', root._w, img)


my_img1= o3d.io.read_point_cloud("z.pcd")
my_img2= o3d.io.read_point_cloud("o.pcd")
my_img3= o3d.io.read_point_cloud("p.pcd")
my_img4= o3d.io.read_point_cloud("u.pcd")
my_img5= o3d.io.read_point_cloud("person.pcd")
image_list = [my_img1, my_img2, my_img3, my_img4,my_img5]
print()
o3d.visualization.draw_geometries([image_list])


my_label = Label(image=my_img1)
my_label.grid(row=0, column=0, columnspan=3)

def forward(image_number):
global my_label
global button_forward
global button_back

my_label.grid_forget()
my_label = Label(image=image_list[image_number-1])
button_forward = Button(root, text=">>", command=lambda: forward(image_number+1))
button_back = Button(root, text="<<", command=lambda: back(image_number-1))

if image_number == 5:
button_forward = Button(root, text=">>", state=DISABLED)

my_label.grid(row=0, column=0, columnspan=3)
button_back.grid(row=1, column=0)
button_forward.grid(row=1, column=2)

def back(image_number):
global my_label
global button_forward
global button_back

my_label.grid_forget()
my_label = Label(image=image_list[image_number-1])
button_forward = Button(root, text=">>", command=lambda: forward(image_number+1))
button_back = Button(root, text="<<", command=lambda: back(image_number-1))

if image_number == 1:
button_back = Button(root, text="<<", state=DISABLED)

my_label.grid(row=0, column=0, columnspan=3)
button_back.grid(row=1, column=0)
button_forward.grid(row=1, column=2)



button_back = Button(root, text="<<", command=back, state=DISABLED)
button_exit = Button(root, text="Exit Program", command=root.quit)
button_forward = Button(root, text=">>", command=lambda: forward(2))


button_back.grid(row=1, column=0)
button_exit.grid(row=1, column=1)
button_forward.grid(row=1, column=2)

root.mainloop()
Larz60+ write Feb-15-2022, 10:10 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use BBcode tags on future posts.
Reply


Messages In This Thread
Creating a GUI for Point Cloud visualisation - by khablt96 - Feb-15-2022, 04:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] Cloud app development league55 1 2,316 Apr-05-2018, 07:55 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020