0

I have been using the picamera for a few days, and the picamera Python library. I have exhausted the picamera image effect library options. I am looking for effects such as warp, and distort. Can this be done easily with the picamera library, or what library can I import to do things like warp, and distort images?

  • picamera just permits access to the effects already implemented in the closed source camera firmware, i.e. there's no way to extend them from within picamera. Warp, distort and other geometric effects can be accomplished in image libraries (like OpenCV, suggested in the answer below), but getting them to run in real-time is extremely unlikely (they'll be running on the CPU, rather than in the GPU where the current effects are implemented) – Dave Jones Aug 5 '16 at 14:57
  • It might be possible to implement such real-time effects via the OpenGL / ES layer (which would be using the GPU for the heavy lifting) but integration with OpenGL / ES is not something I've found time to look into (it's one of the picamera tickets that dates back several years now, but given I'm not a graphics coder by trade, it requires fairly substantial learning on my part - sadly not something I have time for at the moment). – Dave Jones Aug 5 '16 at 15:00
1

Such kind of image processing requires an advanced image processing library. One of the most popular and used library is OpenCV. You can build and compile your own OpenCV or just download the regular library.

  1. To build and compile your own OpenCV, you can follow up my cheat sheet. I am not using Virtual Environment. If you want to install it in virtual environment you can also follow the PyImageSearch well organized tutorial.

  2. If installing the regular library type one of these two commands.

for Python 2: sudo apt-get install python-opencv

for Python 3: sudo apt-get install python3-opencv

Also the answer to your question is the same as my answer here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.