Thursday, May 19, 2016

OpenCV Libfreenect and Spyder Python

Last few hours were a total waste due to unskilled googling !!

Setup a kinect in Ubuntu 12.04 and connected with Spyder.


With the above tutorial you can have a nice visualization with the Kinect from your Linux/Ubuntu Terminal. I believe you will have a "libfreenect " folder by now built in your installation destination.

The next step is to interface "libfreenect" with "Spyder"

  1.  Open the "Wrappers" folder in your "libfreenect" installation.
  2.  Enter into "Python 2" folder and copy "freenect.py"



  3.  Enter "Anaconda2" installation folder and open "lib" folder


      4. Python 2.7 contains all the supporting library files for accessing. If you are a Windows user, you paste your opencv file "cv2.pyd" in the same following steps

    Saturday, May 14, 2016

    Qt Vs Tkinter Backend-Matlabplot in Python

    Being a beginner to Python, I was lost in iPython provided by Anaconda. This post is helpful if you are only using Spyder as your Python interface.

    In the process of developing a very basic GUI to input graph nodes into Python and Gurobi I came across this insight.

    If you are familiar with "matplotlib" you can understand that you can't plot directly or perform "ginput" from ipython console as by default Python is set to Inline. I had read through Stackoverflow that we need to change preferences in the Tool --> Preferences Option.


    Under iPython Console option you can find the graphics Tab. In this window change your backend to TKinter. If you are interested read through what actually QT and TKinter is about, I am just here to specify that QT backend was quite slow in response vs TKinter in plotting matplotlib.


    I dont want to add a Video explaining this because I am kinda lazy. If you are one too just use TKinter and if you are an experimenter test with both the cases. 

    All these claims are only based on my limited knowledge. I don't claim and neither am I an expert in Python. This post is just a reminder for myself as my memory is highly volatile. 

    Dont forget to Restart Spyder !! For dummies like me :)