So I am taking a digital image processing class that requires implementing some image filters, reconstruction, enhancements. I plan to use python for it but my professor wants to have a simple GUI with two canvas for pre- and post-processing images, a drop down box for filter selection, some textboxes for filter value/thresholds and stuff. I have the following questions to ask:
Is it possible to load image to a canvas in python GUI library?
Does the advantage from coding out-weight the disadvantages of having to code the GUI manually?
Given the requirements, what would be the best and easiest library to use? I choose python since it reduces implementation time, but if the GUI turns out to be a bummer I would rather use Java.
If the answer for the 3 previous questions are YES, please point me in the right direction with some documents.
Thank you!
I recommend writing the processing code separately, then writing a GUI wrapper around it.
There are many choices, however I'd consider the big three below:
Tkinter, in the standard install, simple but a bit clunky.
wxPython, a better choice, higher quality but a bit more complicated. Uses native widgets.
PyQT, many love this toolkit and its documentation. I have only limited expertise with it. Uses custom drawn widgets.
Look at Phatch. It is a Python Photo Batch Processor with a nice graphical user interface. It is based on PIL imaging library which you'll probably want to use.
Related
I am developing a 3D Graphing Calculator software in Unity3D. I am struggling to find good numerical/symbolic math libraries written in C/C#. Also, I want to make the calculator programmable (like the TI-84 Calculators everyone uses in school).
I found Python to be a very good language for the backbone of this project. SymPy and NumPy are really good math libraries. And Python would be really good for users to program the calculator. (Here is already a calculator, the Numworks, that supports Python programs. The team ported Python to the hardware.)
If I am developing for the PC, I could just use Python with openGL, or use IronPython in Unity.
However, I'm developing for the Nintendo 3DS. It may sound like a strange hardware choice, but it makes good sense. The 3DS has a stereoscopic display perfect for showing 3D functions. It has a joy stick to operate the camera. It has a touch screen to handle input. Imagine showing a height map of a 3D function on the lower display. You can use it to trace the function. You can draw a region D on it, and have the 3DS integrate over the region. You can take directional derivatives with your stylus. The possibility is endless.
The problem, of course, is that Unity doesn't support Python, and IronPython only supports Windows/Mac/Linux/Android.
Do you have any suggestions for me?
For example, any possible way to use python in unity for the 3DS? Any good math library in C/C#? Can I implement a good enough Python interpreter in C# to handle user's program (doesn't have to be complaint)?
You could try the Math.Net library for C#, it should have the functionality you need, or you could try IronPython, here is an article that might help you get started.
http://shrigsoc.blogspot.com/2016/07/ironpython-and-unity.html
I have a series of points (x,y,z) that I would like to plot as a vector in a 3D plane. Something like this.
I am successfully using QCustomPlot elsewhere, but the documentation says it cannot be used for 3D plots. Googling turned up QwtPlot3D, but it hasn't been maintained since 2007, as far as I can tell, and I don't want to run into any problems since I'm using Qt5. I was also looking at QtCharts but can't seem to find any example of plotting x,y,z data points.
Does anyone have tips for including a 3D graph in my C++/Qt application? Is there a tool that would work better with Python with Qt, rather than C++? Or another technology entirely? This graph will be part of a larger UI.
This might help, though I haven't used it:
http://doc.qt.io/QtDataVisualization/
Spend a little time looking into OpenGL. To display OpenGL scenes in Qt you would use QGLWidget (for Qt 4.x) or QOpenGLWidget (for Qt 5.x). OpenGL allows you to write graphics that run on a GPU card, meaning you can tap into the same horsepower used for 3D video games. Given time and inclination, you can build up a good 3D graphics library.
https://www.opengl.org/
http://doc.qt.io/qt-5/qopenglwidget.html
The Qt tutorials can help, but you'll also want to read other OpenGL tutorials. Here are some tutorials targeting older versions of Qt:
ftp://ftp.informatik.hu-berlin.de/pub1/Mirrors/ftp.troll.no/QT/pub/developerguides/qtopengltutorial/OpenGLTutorial.pdf
http://www.decom.ufop.br/sibgrapi2012/eproceedings/tutorials/t3-survey_paper.pdf
Tutorials tend to start with "immediate mode" examples, meaning the CPU is continually involved with updating data and writing that data to the GPU. As soon as you grasp the basics you'll want to implement "retained mode" code, meaning (very loosely) that the GPU manages the data and the need for CPU resources is minimized.
All that said, getting into OpenGL is a commitment. If you want the user to be able to change the viewpoint of the chart, or zoom in/out, or mouse over a plot to check individual values, etc., then it will take some time to implement. For a standard that's so widely use it's odd that the documentation and available textbooks aren't better--don't expect to find the OpenGL textbook equivalent of Kernighan & Ritchie or the Perl camel book.
There may be some Qt 3D graphing project somewhere that enjoys active development, and with luck maybe some other SO user will know about one.
I am currently in a project where a lot of 3D printing designs need to be done. They are all parameterized, so I'd like to write a python code to generate those design files (in .STL format) for me. I was wondering that, is there a python package that can do this? Because currently I am all doing those by hand using SolidWorks.
Thanks!
Yes there is... It's called FreeCAD.
The assembly module is already in the devel version (as of 06/15/2014) and will be of production quality really soon for real assemblies!
http://freecadweb.org/
Yes, more than one.
In my humble experience, I tried many Open Source tools for parametric CAD modeling using Python (FreeCAD, Rhino-Grasshopper, Blender, Salome).
All of them are valid options and the best one is represented by your ability to either model or code.
I recently favour SALOME (www.salome-platform.org) because of the straight forward "dump study" option, the continue development and the good API documentation.
Particularly I did some 3d prints using the exportSTL command once I had a solid worthy of printing and it was ok.
Nevertheless, if you intend to work on surfaces rather than solids, I don't think you will find anything worthy Open Source (Rhino has a little price to pay).
There is also a new one ! called pymadcad
It's a library meant to do complete CAD stuff only with python scripts.
At contrary to FreeCAD, Pymadcad is natively dealing with triangular meshes so it makes it very easy to import/export .stl files.
There is a growing amount of surface generation functions (extrusion, revolution, tube, screw, smooth surface, ...). And there is also all the stuff to generate and deal with 3D primtives such as Lines, Arc, ...
Here is a brief look at the features
I have a 3d model that consists of points, lines and balls in space. For debugging, it would be nice to render these objects in real time and rotateable.
What are my easiest options to achieve this in python?
Since I know nothing about graphical programming, I'd like to write as litte boilerplate code as possible.
The easiest way to get 3d graphics on screen in python is VPython, though if your model is stored in a CAD file format, you'll need some other library to load the data. With just VPython, you will either need to hard-code the model or implement your own loader.
Two options I'd consider myself (depends what you're trying to do in the end):
Blender has fairly amazing Python integration. Simple example here. As I understand it, Blender's own file save format is executable python which prods the Blender Python API to reconstruct the scene. There's also a mechanism for introducing gamey logic into the Blender world but I know even little about it. Blender does have a crazy steep learning curve though.
Get into OpenGL using the Python OpenGL bindings. "Simple" example.
If you're more interested in creating the models, go with the former; if you're more interested in the rendering of them, go with the latter.
The first thing that springs to mind is processing which is an easy to use visualization toolkit. Although you actually implement your visualizations in java, a quick google found this which lets you write your sketches in python instead.
Essentially what I would like to do is draw a circuit diagram in a PyQt based on input given from another part of the GUI. My first thought was to simply use graphical tiles, and switch them out as pixmaps based on the input, but that is pretty clunky.
I suppose finding a way to actively display dia diagrams in a frame of the GUI would work as well.
Regardless, how would you recommend going about doing this? Is there as easier way?
Thanks!
Edit: Does anyone have experience with any of the following?
http://code.google.com/p/pydot/
http://code.google.com/p/python-graph/
http://code.google.com/p/yapgvb/
http://live.gnome.org/Dia/Python
To anyone that needs to go down this route in the future, the best option was definitely pydot. Easy to use, and pretty full-featured. Way to go, Graphviz.