问题
I am writing an application for image processing. I am just wondering which programming language would be the best fit. Python or PHP. This process is system based not web based so I am just thinking if Python could be of more help.
Let me know your thoughts!
回答1:
Python has stuff like SciPy and PIL so probably Python.
Here is how people use it:
Peak detection in a 2D array
How can I improve my paw detection?
回答2:
One cannot suggest much without knowing the kind of image processing you have in mind.
If you just want to do some generic rotate/resize/etc then I guess there isn't much difference.
If you want to do something more complex, then study the libraries and decide which fits best for your particular task.
If you want to do something really custom, then C or similar language might be a better fit for the task.
回答3:
Possibly neither; it depends on what you want to do.
Both PHP and Python are scripting languages, and are therefore not suited for high-performance numerical routines (which most image processing requires). However, they both have a number of image-processing libraries available for them, the innards of which are probably written in C. These will be fast.
If these libraries do what you want, then fine. If you need to so something custom, then you're probably better off with C or C++ (or Pascal, or whatever) if speed of execution is of concern.
回答4:
Python is more clean and readable. For image processing there is the imageMagic library available for Python and PHP too.
If you want to do some other complex image processing, which cannot by done using a library and you still want to do it in Python or PHP, then Python is defenitely the answer as Python can be extended with C -- But, wait, you didn't mention programming in C, well, there is Cython! It would allow you to write Python modules which are afterwards compiled to C
回答5:
It really depends on what you want to do with the images. You probably should just use a batch or similar script to run a command that does the processing your looking for.
Between the two languages, I would go with python. The command line interface for php is only a recent addition, while python was designed primarily as a scripting language, not for serving pages. For a console application, python is a better fit.
来源:https://stackoverflow.com/questions/4641187/php-or-python-for-image-processing