How to use tkinter (or alternatives) in my MATLAB program ?
Show older comments
This is my code below:
function inputbox(self)
self.master = Tk();
self.master.title("Camera Calibration");
label = "What do you want to do?";
text1 = "Calibrate working plane in camera coordinate system";
text2 = "Calibrate camera in robot flange coordinate system";
text3 = "Calculate the robot coordinaes of a point (pixel) in your image";
text4 = "Calculate calibration matrix for pixel to mm (only if camera || work plane)";
text5 = "Calculate an undistorted pixel";
%self.var1, self.var2, self.var3, self.var4, self.var5 = (IntVar() for i = range(5)end)
self.var1=m.Var();
Label(self.master, text=label).grid(row=0, sticky=W);
Checkbutton(self.master, text=text1, variable=self.var1).grid(row=1, sticky=W);
Checkbutton(self.master, text=text2,command=self.var_states, variable=self.var2).grid(row=2, sticky=W);
Checkbutton(self.master, text=text3, command=self.var_states, variable=self.var3).grid(row=3, sticky=W);
Checkbutton(self.master, text=text4, command=self.var_states, variable=self.var4).grid(row=4, sticky=W);
Checkbutton(self.master, text=text5, command=self.var_states, variable=self.var5).grid(row=5, sticky=W);
Button(self.master, text='Start', command=self.main).grid(row=6, sticky=W, pady=4);
Button(self.master, text='Quit', command=self.master.quit).grid(row=7, sticky=W, pady=4);
self.master.mainloop();
end
function inputbox2(self)
self.master2 = Tk();
self.master2.title("Pixel to robot coordinates");
label = "Insert the pixel coordinates and the number of the image position";
text1 = "x / column: ";
text2 = "y / row: ";
text3 = "Number of image position: ";
Label(self.master2, text=label).grid(row=0, sticky=W);
Label(self.master2, text=text1).grid(row=1, sticky=W);
Label(self.master2, text=text2).grid(row=2, sticky=W);
Label(self.master2, text=text3).grid(row=3, sticky=W)
self.e1 = Entry(self.master2);
self.e1.grid(row=1, column=1);
self.e2 = Entry(self.master2);
self.e2.grid(row=2, column=1);
self.e3 = Entry(self.master2);
self.e3.grid(row=3, column=1);
Button(self.master2, text='Accept values', command=self.pixel2robot).grid(row=4, sticky=W, pady=4);
Button(self.master2, text='Quit', command=self.master2.destroy).grid(row=5, sticky=W, pady=4);
self.master2.mainloop();
end
function inputbox3(self)
self.master3 = Tk();
self.master3.title("Undistort Pixel");
label = "Insert the pixel coordinates and the number of the image position";
text1 = "x / column: ";
text2 = "y / row: ";
text3 = "Number of image position: ";
Label(self.master3, text=label).grid(row=0, sticky=W);
Label(self.master3, text=text1).grid(row=1, sticky=W);
Label(self.master3, text=text2).grid(row=2, sticky=W);
Label(self.master3, text=text3).grid(row=3, sticky=W)
self.e11 = Entry(self.master3);
self.e11.grid(row=1, column=1);
self.e22 = Entry(self.master3);
self.e22.grid(row=2, column=1);
self.e33 = Entry(self.master3);
self.e33.grid(row=3, column=1);
Button(self.master3, text='Accept values', command=self.undistort_pixel).grid(row=4, sticky=W, pady=4);
Button(self.master3, text='Quit', command=self.master3.destroy).grid(row=5, sticky=W, pady=4);
self.master3.mainloop()
end
I want to create like this GUI:

I am trying with my code but problem is Tk() function which is not supported in matlab program. Please anyone help me.
Accepted Answer
More Answers (0)
Categories
Find more on Camera Calibration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
