Feb-15-2022, 04:41 PM
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:
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()